Hello there^^.
I have Basically in my mini game all the important scripts attached to the Main Camera.
I got a bunch of buttons who activate some of those scripts attached to this main camera, something like
In Button 1:
On click
Activate : Main Camera → script X , Function Y
In this script i want to get the Button name, but i have no idea how.
In the Function Y, somethis like “this.name” give me the name of the the script attachement, here the Main Camera, but i want the “Button 1” name.
Is there a way to get it ?
Its to do something like this :
public void MenuInvoc1_OpenClose () {
GameObject Button = ButtonWhoActivateTheScript;
for (int i=0; i < 12; i++) {
if (Button.name == "button"+i) {
onclickInvoc = i;
}
}
StartCoroutine(MenuInvocMove (.5f));
}
Thanks a lot^^.