I'm making my UI completely in-scene using custom Unity UI. Menus/Canvases are childed to the player character, and appear in 3D space when activated.
However, the Serializer isn't finding them in the Menu.LoadUnityUI() function.
Or, more precisely, the Serializer does find them once at the beginning, when the call stack is:
AC.PlayerMenus:OnStart() > AC.PlayerMenus:RebuildMenus(MenuManager) > PlayerMenus.AC.Menu:LoadUnityUI()
But after that, the SaveSystem runs SceneLoaded()>OnLevelWasLoaded(), and consequently ResetSceneObjects() > PlayerMenus.AfterLoad() >Menu.LoadUnityUI().
This time, the Serializer can no longer find UI canvas or rect transform via searching for the constant ID, even though the Constant ID component is still present on the canvas.
I'm assuming there's something happening during that whole response to scenes finishing loading that is fudging things up, but I haven't gotten too deep into (and am a bit frightened to) the SaveSystem.
Thanks for any help!
Comments
For what reason as you parenting the UIs to your Player? Try instead to keep them separate, and use a script to copy them to the player's transform each frame.
I'll keep fiddling with it. I was kind of just hoping there was a quick and simple answer XD
If I don't figure it out, I might have to try that scripting.
As for the parenting UI to the player - my game is entirely in first person - when the player opens a menu, their character pulls out a tablet using the player character's arms and animation rig. So it made sense to have the UI canvases childed to the rig/tablet as well.
No luck, same issue. Tried both Unity UI in Scene and Unity UI Prefab for the AC menu settings.
Be sure that you are using the very latest release, v1.55c. Parenting your UIs to the Player should be fine, provided that the Player itself is part of the scene file, and not instantiated at runtime by AC.
When the UI is not appearing but should be, pause the game and view it in the Hierarchy to see what's going on. Is it disabled, or positioned in the wrong place?
The first step when debugging Menus should be to switch the Menu's Source field to Adventure Creator, make sure it's previewing correctly in the Game Window, and then test it. This is to determine if the issue lies with AC, or Unity UI.