Closed unagiHuman closed 8 years ago
Thanks, I hope to find time to take a look at this. It's very hard working with playmode compability in Unity due to the lack of callbacks and general information:(
I debug the above bug and I found the cause of bug. Although Texture of memory is released when I stop the playmode of UnityEditor, null InKnobTex and OutKnobTex in TypeData is referenced by ReloadTexture() in NodeKnob class.
The reason for the memory of non-KnobTexture has not been released, Texuture except KnobTexture's is static variable.
Bug of the solution's two ways of following. 1.KnobTexture change static variable
Maybe I'll find ways (not in the soon future though:( ) to get more callacks out of Unity which will hopefully help with this. For now it might be a good idea to try one of the callbacks in EditorLoadingControl (like the cache system) in NodeEditorWindow and calling NodeEditor.ReInit in one of them;)
I had the same issue, I fixed it by calling TypeData.FetchTypes() if the texture cannot be found, which is a little bit hacky I agree
May seem hacky, the cause is simply that the playmode switch seems to erase the data. So a different, maybe less hacky way would be to completely reinit the Node Editor in one of the callbacks in EditorLoadingControls, which the cache system are using. I won't check that out though because I cannot work on the project until next week:(
Btw this has been fixed in cc44390!
When I open the NodeEditor, and change the Unity playmode to stopped state, error occurs that Knob texture can not be loaded. In the source code, In EditorApplication.playmodeStateChanged, Node Editor trying to LoadCache at the timing to stop the application, but seemed to have failed in an attempt to load the Knob texture in UnityEditor.AssetDatabase.LoadAssetAtPath.