I double clicked the AP, make it fullscreen. Then, double clicked again to exit fullscreen. I've got the following error. I restarted the project the get sure. It is an error on 1.4.2
From your additional posts, we did some more testing.
And the error similar to what you reported is when I repeat activation > deactivation > activation of the AnyPortrait editor while docked.
You can reproduce this issue by taking an action such as launching the game, and the detailed error log may vary slightly depending on the action taken.
The "error log from apEditor" you mentioned occurs "when uninitialized data is accessed", but the problem is that this is not constant.
If it's a problem with the same data, we can fix it by correcting it to detect it.
Actually, but the error log in your comment is caused by "resources for rendering" being unloaded, while in our test it was caused by "user's configuration data" being unloaded.
And other users in the past have reported similar errors in completely different code.
Therefore, we cannot solve the problem with this approach.
Our team wrote a script in Unity 2022.2 and received information and events related to docking from the Unity Editor and checked it.
As you said, if we put "Validation" code in it, i.e. if it detects that the docked editor is Unmaximized or temporarily Invisible, we can force reset to run again.
But the Unity API doesn't provide developers with enough information about this, so we didn't have enough information about the state of the editor.
It even passed an invalid state value.
In fact, in our "Maximize > Unmaximize test", the "docked" state value was passed as false (!) right before the error occurred. (Of course, docking was maintained, and AnyPortrait editor was forcibly terminated afterwards.)
As a result, both methods of (1) monitoring data that can be deleted on docking or (2) writing docking-related events and validation code are currently impossible.
Our team, like other developers, has to rely on the API provided by Unity, which has yet to give us a proper solution.
In Unity 2020.1 - it's very late! -, Unity started providing "docked" information in the editor, and our team hopes that Unity will provide more information and events to developers.
It's really very sad that we can't fix this issue yet, and if a completely different approach that we haven't tried comes up on the forums, we'll be happy to try it.
It is a pity that it is due to the missing Unity side.
Now I tested the "Maximize while window docked" with another custom plugin. For this another custom plugin, while docking enabled, I double-clicked to maximize it. Double-clicking it wouldn't let me unmaximize (strange!) and Unity printed an error in the console. *But I was able to minimize it after pressing the three dots in the top right and clicking the Maximize button.* And the docked tab did not close itself, unlike AnyPortrait.
It closes completely in AnyPortrait when you do the same steps and I have to open Window > AnyPortrait > 2D Editor again.
Hi!The following errors appears when Unity project launches as AnyPortrait docked at start (Please see the attached video).
GUI Error: You are pushing more GUIClips than you are popping. Make sure they are balanced.
Exception : System.NullReferenceException: Object reference not set to an instance of an object (AnyPortrait.apEditor:OnGUI () (at Assets/AnyPortrait/Editor/Scripts/apEditor.cs:2900))
GUI Error: Invalid GUILayout state in apEditor view. Verify that all layout Begin/End calls match
We have reported errors related to Maximize and Unmaximize.
We tried to solve this, unfortunately, but it was impossible. :(
To guess, Maximize/Unmaximize is not just a function of adjusting the size of the editor, but will contain additional processing that initializes the editor or handles it inside the Unity Editor.
In some Unity Editor versions, you can see similar error logs when Maximize-> Unmaximize of Unity's "Scene View" other than AnyPortrait.
To be more closely, this is probably an error that occurred when an editor window that requires an "Initialization/Loading" process, such as AnyPortrait, is docked.
If you look closely at the error log you sent, you can see that the error log occurred inside the Unity Editor, not AnyPortrait.
(If a null exception occurred somewhere in the code of AnyPortrait, we made it printed as an error log where it occurred in the AnyPortrait code.)
This error occurs when the Editor Window is docked to the Unity Editor, so what we recommend is to put AnyPortrait into a separate window without docking to the Unity editor.
We are also very sorry that we cannot solve your inconvenience.
If we are looking for a solution to this issue (or if the Unity editor is updated), we will apply it to the update.
Hi!
From your additional posts, we did some more testing.
And the error similar to what you reported is when I repeat activation > deactivation > activation of the AnyPortrait editor while docked.
You can reproduce this issue by taking an action such as launching the game, and the detailed error log may vary slightly depending on the action taken.
The "error log from apEditor" you mentioned occurs "when uninitialized data is accessed", but the problem is that this is not constant.
If it's a problem with the same data, we can fix it by correcting it to detect it.
Actually, but the error log in your comment is caused by "resources for rendering" being unloaded, while in our test it was caused by "user's configuration data" being unloaded.
And other users in the past have reported similar errors in completely different code.
Therefore, we cannot solve the problem with this approach.
Our team wrote a script in Unity 2022.2 and received information and events related to docking from the Unity Editor and checked it.
As you said, if we put "Validation" code in it, i.e. if it detects that the docked editor is Unmaximized or temporarily Invisible, we can force reset to run again.
But the Unity API doesn't provide developers with enough information about this, so we didn't have enough information about the state of the editor.
It even passed an invalid state value.
In fact, in our "Maximize > Unmaximize test", the "docked" state value was passed as false (!) right before the error occurred. (Of course, docking was maintained, and AnyPortrait editor was forcibly terminated afterwards.)
As a result, both methods of (1) monitoring data that can be deleted on docking or (2) writing docking-related events and validation code are currently impossible.
Our team, like other developers, has to rely on the API provided by Unity, which has yet to give us a proper solution.
In Unity 2020.1 - it's very late! -, Unity started providing "docked" information in the editor, and our team hopes that Unity will provide more information and events to developers.
It's really very sad that we can't fix this issue yet, and if a completely different approach that we haven't tried comes up on the forums, we'll be happy to try it.
We will continue to monitor this issue.
Thank you.
Hi! The following errors appears when Unity project launches as AnyPortrait docked at start (Please see the attached video).
GUI Error: You are pushing more GUIClips than you are popping. Make sure they are balanced.
Exception : System.NullReferenceException: Object reference not set to an instance of an object (AnyPortrait.apEditor:OnGUI () (at Assets/AnyPortrait/Editor/Scripts/apEditor.cs:2900))
GUI Error: Invalid GUILayout state in apEditor view. Verify that all layout Begin/End calls match
Hi!
We have reported errors related to Maximize and Unmaximize.
We tried to solve this, unfortunately, but it was impossible. :(
To guess, Maximize/Unmaximize is not just a function of adjusting the size of the editor, but will contain additional processing that initializes the editor or handles it inside the Unity Editor.
In some Unity Editor versions, you can see similar error logs when Maximize-> Unmaximize of Unity's "Scene View" other than AnyPortrait.
To be more closely, this is probably an error that occurred when an editor window that requires an "Initialization/Loading" process, such as AnyPortrait, is docked.
If you look closely at the error log you sent, you can see that the error log occurred inside the Unity Editor, not AnyPortrait.
(If a null exception occurred somewhere in the code of AnyPortrait, we made it printed as an error log where it occurred in the AnyPortrait code.)
This error occurs when the Editor Window is docked to the Unity Editor, so what we recommend is to put AnyPortrait into a separate window without docking to the Unity editor.
We are also very sorry that we cannot solve your inconvenience.
If we are looking for a solution to this issue (or if the Unity editor is updated), we will apply it to the update.
Thank you.