Exemplo n.º 1
0
    static void DrawFSMlist(float width, float height)
    {
        ActionMenuTools      tools = ActionMenuTools.GetInstance();
        HashSet <NodeCanvas> clist = new HashSet <NodeCanvas>(tools.Loadedcanvases);

        NodeCanvas currentcanvas = NodeEditorInterface.GetInstance().canvasCache.nodeCanvas;

        GUILayout.Label(new GUIContent("Current load Canvas Cnt " + clist.Count));
        if (GUILayout.Button("Reload FSM"))
        {
            LoadFSM();
        }

        int i = 0;

        foreach (NodeCanvas loaded in clist)
        {
            if (loaded != null)
            {
                RTEditorGUI.Toggle(currentcanvas != null && currentcanvas == loaded, new GUIContent("[" + i + "]"));
                UnityEditor.EditorGUILayout.ObjectField(loaded, typeof(NodeCanvas), false);
                if (GUILayout.Button("load"))
                {
                    NodeEditorInterface.GetInstance().canvasCache.LoadNodeCanvas(loaded, false);
                }

                i++;
            }
        }
    }
Exemplo n.º 2
0
 void ExitPlay()
 {
     if (NodeEditorInterface.GetInstance().canvasCache != null)
     {
         NodeEditorInterface.GetInstance().canvasCache.NewNodeCanvas(typeof(EmptyCanvas));
     }
     this.Loadedcanvases.Clear();
     CurrentCustomMenu = null;
 }
Exemplo n.º 3
0
    void ReloadCanvasList(List <NodeCanvas> list)
    {
        this.Loadedcanvases.Clear();

        if (list != null && list.Count > 0)
        {
            this.Loadedcanvases.AddRange(list);
            NodeEditorInterface.GetInstance().canvasCache.LoadNodeCanvas(list[0], false);
        }

        ListPool.TryDespawn(list);
    }
Exemplo n.º 4
0
        public override bool isValid()
        {
#if UNITY_EDITOR
            if (NodeEditorInterface.GetInstance().isOpenedWindows)
            {
                bool valid = Type != null && InKnobTex != null && OutKnobTex != null;
                if (!valid)
                {
                    LogMgr.LogError("Type " + Identifier + " is invalid! Type-Null?" + (type == null) + ", InTex-Null?" + (InKnobTex == null) + ", OutTex-Null?" + (OutKnobTex == null));
                }
                return(valid);
            }
#endif
            return(true);
        }
Exemplo n.º 5
0
        public override bool isValid()
        {
#if UNITY_EDITOR
            if (NodeEditorInterface.GetInstance().isOpenedWindows)
            {
                return(InKnobTex != null && OutKnobTex != null);
            }
            else
            {
#endif
            return(true);

#if UNITY_EDITOR
        }
#endif
        }
Exemplo n.º 6
0
        protected void LoadKnobTextures()
        {
#if UNITY_EDITOR
            if (NodeEditorInterface.GetInstance().isOpenedWindows)
            {
#endif
            _inKnobTex  = NodeResourceManager.GetTintedTexture(InKnobTexPath, Color);
            _outKnobTex = NodeResourceManager.GetTintedTexture(OutKnobTexPath, Color);
            if (InKnobTex == null || OutKnobTex == null)
            {
                LogMgr.LogError("Invalid style '" + Identifier + "': Could not load knob textures from '" + InKnobTexPath + "' and '" + OutKnobTexPath + "'!");
            }
#if UNITY_EDITOR
        }
#endif
        }
Exemplo n.º 7
0
 private void AssureSetup()
 {
     if (canvasCache == null)
     { // Create cache and load startup-canvas
         canvasCache = new NodeEditorUserCache();
         if (canvas != null)
         {
             canvasCache.SetCanvas(NodeEditorSaveManager.CreateWorkingCopy(canvas));
         }
         else if (!string.IsNullOrEmpty(loadSceneName))
         {
             canvasCache.LoadSceneNodeCanvas(loadSceneName);
         }
     }
     canvasCache.AssureCanvas();
     if (editorInterface == null)
     { // Setup editor interface
         editorInterface             = new NodeEditorInterface();
         editorInterface.canvasCache = canvasCache;
     }
 }