Heyo, I upgraded to 1.47 recently, and I'm having a problem with my Menus.
I have one on-screen button, which, when pressed, opens a second Menu and fills the label on it with a specific text when opening, like this:
public static void OnMenuEnable (AC.Menu _menu)
{
if (_menu.title == "Dossier") {
//these declarations are usually in void Start() but I put them here for readability, that's why I'm not using _menu:
MenuLabel notestitle = PlayerMenus.GetElementWithName ("Dossier", "Title") as MenuLabel;
MenuLabel notes = PlayerMenus.GetElementWithName ("Dossier", "Notes") as MenuLabel;
//clears the label with a default message when opening the Menu
notestitle.label = string.Empty;
notes.label = "Select a topic from the list to learn more.";
}
}
But since 1.47 I get a nullref that it can't find the label, and so the second Menu never opens.
There is also a toggle in the options Menu that I try to set in a similar way on gamestart, and that too gives a nullref. It's almost like using anything PlayerMenus related in a script doesn't work.
Crazy thing is: this happens everywhere, including in newly-created scenes, EXCEPT the main menu scene and the Intro scene, and for the life of me I can't figure out why. There's nothing in the starting cutscenes of those scenes that does anything that the other scenes don't as far as I can tell. But it has to be in there I guess. I'm stumped.
All my Menus are AC ones, no UnityUIs.
Comments
You can work around this by amending their relative execution orders by clicking on both scripts in the Project window and amending their Script Execution Order so that your own script runs after PlayerMenus.