Hello,
I am learning about this stuff now and need some help.
My script I wish to keep as simple as I can, I need to know how to return the proper call, to add a listener object to an instantiated ui button object in the onClick() area.
Here is my code:
// Update is called once per frame
void Update () {
if (!manager) {
Call();
button.onClick.AddListener(Call);
}
}
public GameObject Call() {
if (!manager)
{
manager = GameObject.FindGameObjectWithTag("Manager");
}
return manager;
}
}
I know its really simple and doesn’t work, I need to understand how to write the call return type, so I can change my code to work so I can add a listener easily and edit its goodies lol, you know, direct it to its target and the script on the target and direct to what to do with it.
Please help?