- Home /
Multi Button Script Help
Ok so I've looked around and I have had no luck finding it. Basically I want to set up a parameter of when two specific buttons are clicked, a certain text populates.
For example. If I click Option A and then Option B, then the text Option AB populates. But then If I click Option C and then Option D, then the text Option CD replaces the previous AB text, and so on.
If this is out there somewhere can someone please point me in the right direction?
Answer by AconitumNapellum · Nov 11, 2019 at 02:17 PM
You can check the name of the button that was clicked with
using UnityEngine.EventSystems;
public class ExampleClass : MonoBehaviour
{
void ButtonClicked()
{
string buttonname=EventSystem.current.currentSelectedGameObject.name;
}
}
Then manage remembering which button was pressed and act consequently. Sorry for bad formatting, I’m on cellphone.
Your answer
Follow this Question
Related Questions
How do I make a photography function? 0 Answers
Unity multiple button on click 1 Answer
Script Help for click and auto drop . 0 Answers