/// <summary>
        /// Called multiple times per second on all visible windows.
        /// </summary>
        protected virtual void OnEnable()
        {
            Instance = this;

            if (Editor == null)
            {
                Editor = new NodeEditor();
                //Editor = ScriptableObject.CreateInstance<SpellEditor>();
                Editor.Initialize(Instance.position.width, Instance.position.height);
                Editor.RepaintEvent = Instance.OnRepaint;
            }

            string lPath = Editor.RootAssetPath;

            if (lPath.Length == 0)
            {
                lPath = AssetPath;
            }
            if (lPath.Length > 0)
            {
                Editor.LoadRootAsset(lPath);
            }
        }
 /// <summary>
 /// Called multiple times per second on all visible windows.
 /// </summary>
 protected virtual void OnDisable()
 {
     Editor = null;
 }
 /// <summary>
 /// Callback for repainting the window
 /// </summary>
 protected virtual void OnRepaint(NodeEditor rEditor)
 {
     Repaint();
 }