Hi RainyRizzle,
I hope you are good! I know I've reported a lot of bugs, but I'm reporting them because I encounter them often. I know you're working on fixing them, and I appreciate that.
When I change a scene, I get an "Error Of Changed Scene" error from AnyPortrait in the Console Log. Do you know why?
How to reproduce?
Create AnyPortrait gameobject in two seperated scenes
Switch the scene from A to B (both must have the AnyPortrait gameobject in the scene)
AnyPortrait : Error of Changed Scene
System.NullReferenceException: Object reference not set to an instance of an object
at AnyPortrait.apGUILOFactory.Height (System.Int32 height) [0x00000] in {pathToUnityProject}\Assets\AnyPortrait\Editor\Scripts\Util\GUIWrapper\apGUILOFactory.cs:193
at AnyPortrait.apEditorHierarchyUnit.CheckAndCreateGUIStyle () [0x00040] in {pathToUnityProject}\Assets\AnyPortrait\Editor\Scripts\Hierarchy\apEditorHierarchyUnit.cs:452
at AnyPortrait.apEditorHierarchyUnit.InitPrevRender () [0x00031] in {pathToUnityProject}\Assets\AnyPortrait\Editor\Scripts\Hierarchy\apEditorHierarchyUnit.cs:327
at AnyPortrait.apEditorHierarchyUnit..ctor () [0x000fe] in {pathToUnityProject}\Assets\AnyPortrait\Editor\Scripts\Hierarchy\apEditorHierarchyUnit.cs:311
at AnyPortrait.apEditorHierarchyUnit.MakeUnit () [0x00000] in {pathToUnityProject}\Assets\AnyPortrait\Editor\Scripts\Hierarchy\apEditorHierarchyUnit.cs:288
at AnyPortrait.apEditorHierarchyUnitPool.CreateUnits (System.Int32 nUnits) [0x00004] in {pathToUnityProject}\Assets\AnyPortrait\Editor\Scripts\Hierarchy\apEditorHierarchyUnit.cs:1613
at AnyPortrait.apEditorHierarchyUnitPool.Init () [0x00012] in {pathToUnityProject}\Assets\AnyPortrait\Editor\Scripts\Hierarchy\apEditorHierarchyUnit.cs:1602
at AnyPortrait.apEditorHierarchy.ResetAllUnits () [0x00048] in {pathToUnityProject}\Assets\AnyPortrait\Editor\Scripts\Hierarchy\apEditorHierarchy.cs:182
at AnyPortrait.apEditor.OnEditorSceneUnloadedOrChanged () [0x00023] in {pathToUnityProject}\Assets\AnyPortrait\Editor\Scripts\apEditor.cs:1070
UnityEngine.Debug:LogError (object)
AnyPortrait.apEditor:OnEditorSceneUnloadedOrChanged () (at Assets/AnyPortrait/Editor/Scripts/apEditor.cs:1078)
AnyPortrait.apEditor:OnEditorHierarchyChanged () (at Assets/AnyPortrait/Editor/Scripts/apEditor.cs:1048)
UnityEditor.EditorApplication:Internal_CallHierarchyHasChanged ()
Thanks in advance!
Hi!
Thanks for sending the full stack of exception.
It seems that the log is caused by some data not being initialized during the process of reinitializing the AnyPortrait editor when switching scenes.
Unfortunately, this error does not occur in our current tests.
Even if we set various states of the editor and then switch scenes, the initialization is completed normally in our tests.
We have received reports from other users about errors occurring when switching scenes or controlling controls in the Inspector. And since the errors occurred intermittently in events in the Unity Editor, it was not easy for us to reproduce the problem.
We will try to fix the script to make it a bit more stable based on the reported logs.
And if this error does not critically affect your work, please ignore it.
We will review it further and reflect it in the update.
If you need additional support on this issue, please leave a comment.
Thank you.