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++; } } }
void ExitPlay() { if (NodeEditorInterface.GetInstance().canvasCache != null) { NodeEditorInterface.GetInstance().canvasCache.NewNodeCanvas(typeof(EmptyCanvas)); } this.Loadedcanvases.Clear(); CurrentCustomMenu = null; }
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); }
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); }
public override bool isValid() { #if UNITY_EDITOR if (NodeEditorInterface.GetInstance().isOpenedWindows) { return(InKnobTex != null && OutKnobTex != null); } else { #endif return(true); #if UNITY_EDITOR } #endif }
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 }
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; } }