So I've tried Keks's second suggestion.
But when I use the call event and select the method I created (close menus) I'm presented with a list of functions (?) I don't know which to choose?
Am I doing this right? what should I choose from the list?
Thanks!
See pics of the script and list -
Nearly there. Just make your "closeAllMenus" function public:
public void closeAllMenus(){
It'll then be an option in the event drop-down.
If you place this component on a GameObject, and then make it a prefab, you can then reference this prefab in the Action so that it can be called from any scene.
Comments
Yes, there's a function for that.
PlayerMenus.ForceOffAllMenus()
Thanks!
How can I call that function at the required time using AGs action lists?
Two options:
Create your own action. Here's official tutorial.
Use the action Object: Call event
void CloseAllMenus() { PlayerMenus.ForceOffAllMenus(); }
Note: Don't forget that your c# script needs to have using AC at the beginning
Place it in a custom script function, and call that function with either the Object: Call event or Object: Send message Actions.
So I've tried Keks's second suggestion.


But when I use the call event and select the method I created (close menus) I'm presented with a list of functions (?) I don't know which to choose?
Am I doing this right? what should I choose from the list?
Thanks!
See pics of the script and list -
Nearly there. Just make your "closeAllMenus" function public:
It'll then be an option in the event drop-down.
If you place this component on a GameObject, and then make it a prefab, you can then reference this prefab in the Action so that it can be called from any scene.