Skip to content
This repository has been archived by the owner on Oct 31, 2023. It is now read-only.

Can´t load a canvas file after exiting Play mode #18

Closed
pmhpereira opened this issue Nov 14, 2015 · 1 comment
Closed

Can´t load a canvas file after exiting Play mode #18

pmhpereira opened this issue Nov 14, 2015 · 1 comment

Comments

@pmhpereira
Copy link
Contributor

When loading a canvas file after exiting Play mode, nothing appears in the Node Editor and a error is thrown.
It also becomes impossible to add new nodes to the canvas. The solution is to start and stop the Play mode.

Steps to reproduce:

  1. Start Play mode in Unity
  2. Press New Canvas in the Node Editor
  3. Exit Playmode
  4. Load Canvas file

MissingReferenceException: The object of type 'Texture2D' 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.NodeKnob.GetGUIKnob () (at Assets/Plugins/Node_Editor/Framework/NodeKnob.cs:143)

@Seneral
Copy link
Owner

Seneral commented Nov 14, 2015

To fix that, add these lines somewhere in NodeEditor.checkInit inside the if block:

#if UNITY_EDITOR
                UnityEditor.EditorApplication.playmodeStateChanged += () => { initiated = false; InitiationError = false; };
#endif

That simply makes sure the NodeEditor is re-inited after entering and editing playmode:)

@Seneral Seneral closed this as completed Nov 14, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants