Seneral / Node_Editor_Framework

A flexible and modular Node Editor Framework for creating node based displays and editors in Unity
https://nodeeditor.seneral.dev
MIT License
2.01k stars 414 forks source link

NodeCanvas destroyed after returning from Play Mode #12

Closed ritave closed 8 years ago

ritave commented 8 years ago

Unity version: 5.1.2p3

If I open the Node Editor, enter the Play mode, stop the Play mode and click on the Node Editor window again it stops responding and I get a lot of repeated errors in the console with the following error:

MissingReferenceException: The object of type 'NodeCanvas' has been destroyed but you are still trying to access it.
Your script should either check if it is null or you should not destroy the object.
NodeEditorFramework.NodeEditorWindow.DrawSideWindow () (at Assets/Editor/Node_Editor/NodeEditorWindow.cs:111)
NodeEditorFramework.NodeEditorWindow.OnGUI () (at Assets/Editor/Node_Editor/NodeEditorWindow.cs:104)
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)
Seneral commented 8 years ago

Strange, last time I chcked the canvas was simply unloaded, which is a minor issue... Thanks for the report, I'll take a look at fixing that today:)

Seneral commented 8 years ago

Adressed that too in my latest commit (2dd6eb8a3e49fe9e1853685282cac4d98dd06522) next to other things, simply added a check for the canvas;)