Hi there,
I have a set of buttons in my scene under the same parent GameObject.
In the script attached to the parent Game Object I need to know which of the buttons has been pressed in order to run different functions.
Since the isPressed() method of Buttons is protected and not publicly accessible, how can I understand which button is pressed?
What I am looking for is a function of this type:
private Button findClickedButton()
{
var buttonList = GameObject.FindObjectsOfType<Button>();
foreach (var curButton in buttonList)
{
// if(curButton.isPressed())
// return curButton;
}
}
Thanks for any support!