I know this question will have many different subjective answers, but I wanted to get other people's ideas on what they think is best practice when it comes to the location for custom menu scripts.
I have tried to centralise all of my custom menu functionality into one script "CustomUIManager.cs" and I have placed it as a component on my InGame menu, which is always present in my game scenes. This is where I put my listeners for mouse over and click events etc.
I was going to use MenuSystem.cs, as that is always present on the GameEngine prefab, but I wasn't sure if this was a good idea or not.
Comments
Menus have a number of custom events that you can use to have code run when one is clicked or mouse-overed - see the "Menu Scripting" chapter of the Manual.
I suppose my question was really where the best place those listener functions/scripts should live. I was thinking of having a single 'manager' script that listens for those events and manipulates all different ui components. But then the menu system (as it lives on the game engine prefab) seemed like an already great spot for it, but wasn't sure if itll be deprecated or not.
Where do you instantiate the pre fab?