Event when menu opened & closed?

I need to execute some logic whenever then main menu (where is shows tabs for inventory, exit, etc) is opened or closed. How can I hook that event? Thank you
 
You can find all the events in the EventNames.cs file
You'll most likely be interested in this event.
Code:
//The panel was opened or closed. The target game object is the panel owner assigned in the PanelManager.
        public const string c_GameObject_OnPanelOpenClose_PanelEventData = "GameObject_OnPanelOpenClose_PanelEventData";
you can get the target panel within the panel event data to check if it is the main menu.
 
I attempted this based on your post and the documentation, but nothing is being fired.

Here's how I'm registering for the event:

It requires you pass an object as the first param. It's ambiguous what this should be. I passed in the Inventory parent-most game object, as well as what seemed to be the appropriate Panel Display Manager.

Please help me out here. If I need to check the target panel (ThisPanel?) to find which panel I'm referring to, then why do I also have to pass a specific panel to register? Do panel events bubble up to their parents, or is this global?

A
 
I'm sorry it wasn't clear. The target game object is the panel owner. In most cases that's the player gameobject.

If you check the post above where I pasted the code snippet. The comment says that the target should be the panel owner.
When you are not sure what the target is you can check the EventNames.cs file. and the name of the event or the comments should tell you what the target is.
 
Top