Example #1
0
        /// <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);
            }
        }
Example #2
0
 /// <summary>
 /// Called multiple times per second on all visible windows.
 /// </summary>
 protected virtual void OnDisable()
 {
     Editor = null;
 }
Example #3
0
 /// <summary>
 /// Callback for repainting the window
 /// </summary>
 protected virtual void OnRepaint(NodeEditor rEditor)
 {
     Repaint();
 }