private static void HandleContextClicks(NodeEditorInputInfo inputInfo)
 {
     if (Event.current.button == 1)
     {
         GenericMenu genericMenu = new GenericMenu();
         if ((UnityEngine.Object)inputInfo.editorState.focusedNode != (UnityEngine.Object)null)
         {
             FillContextMenu(inputInfo, genericMenu, ContextType.Node);
         }
         else
         {
             FillContextMenu(inputInfo, genericMenu, ContextType.Canvas);
         }
         genericMenu.Show(inputInfo.inputPos, 40f);
         Event.current.Use();
     }
 }
Esempio n. 2
0
 [EventHandlerAttribute(EventType.MouseDown, 0)]          // One of the highest priorities after node selection
 private static void HandleContextClicks(NodeEditorInputInfo inputInfo)
 {
     if (Event.current.button == 1)
     {                                                  // Handle context clicks on Node and canvas
         GenericMenu contextMenu = new GenericMenu();
         if (inputInfo.editorState.focusedNode != null) // Node Context Click
         {
             FillContextMenu(inputInfo, contextMenu, ContextType.Node);
         }
         else                 // Editor Context Click
         {
             FillContextMenu(inputInfo, contextMenu, ContextType.Canvas);
         }
         contextMenu.Show(inputInfo.inputPos);
         Event.current.Use();
     }
 }
Esempio n. 3
0
 public void SideGUI()
 {
     GUILayout.Label(new GUIContent("Node Editor (" + canvas.name + ")", "The currently opened canvas in the Node Editor"));
     screenSize = GUILayout.Toggle(screenSize, "Adapt to Screen");
     GUILayout.Label("FPS: " + FPSCounter.currentFPS);
     GUILayout.Label(new GUIContent("Node Editor (" + canvas.name + ")"), NodeEditorGUI.nodeLabelBold);
     if (GUILayout.Button(new GUIContent("New Canvas", "Loads an empty Canvas")))
     {
         NewNodeCanvas();
     }
     GUILayout.Space(6f);
     GUILayout.BeginHorizontal();
     sceneCanvasName = GUILayout.TextField(sceneCanvasName, GUILayout.ExpandWidth(true));
     if (GUILayout.Button(new GUIContent("Save to Scene", "Saves the Canvas to the Scene"), GUILayout.ExpandWidth(false)))
     {
         SaveSceneNodeCanvas(sceneCanvasName);
     }
     GUILayout.EndHorizontal();
     if (GUILayout.Button(new GUIContent("Load from Scene", "Loads the Canvas from the Scene")))
     {
         GenericMenu genericMenu = new GenericMenu();
         string[]    sceneSaves  = NodeEditorSaveManager.GetSceneSaves();
         foreach (string text in sceneSaves)
         {
             genericMenu.AddItem(new GUIContent(text), false, LoadSceneCanvasCallback, text);
         }
         genericMenu.Show(loadScenePos, 40f);
     }
     if (Event.current.type == EventType.Repaint)
     {
         Rect lastRect = GUILayoutUtility.GetLastRect();
         loadScenePos = new Vector2(lastRect.x + 2f, lastRect.yMax + 2f);
     }
     GUILayout.Space(6f);
     if (GUILayout.Button(new GUIContent("Recalculate All", "Initiates complete recalculate. Usually does not need to be triggered manually.")))
     {
         NodeEditor.RecalculateAll(canvas);
     }
     if (GUILayout.Button("Force Re-Init"))
     {
         NodeEditor.ReInit(true);
     }
     NodeEditorGUI.knobSize = RTEditorGUI.IntSlider(new GUIContent("Handle Size", "The size of the Node Input/Output handles"), NodeEditorGUI.knobSize, 12, 20);
     state.zoom             = RTEditorGUI.Slider(new GUIContent("Zoom", "Use the Mousewheel. Seriously."), state.zoom, 0.6f, 2f);
 }
Esempio n. 4
0
 public override void AdditionalSaveMethods(string sceneCanvasName, CompleteLoadCallback onComplete)
 {
     GUILayout.BeginHorizontal();
     if (GUILayout.Button(new GUIContent("Load Yaml", "Loads the Canvas from a Yaml Save File")))
     {
         Load(sceneCanvasName, onComplete);
     }
     if (GUILayout.Button(new GUIContent("Save to Yaml", "Saves the Canvas to a Yaml file"), GUILayout.ExpandWidth(false)))
     {
         BeforeSavingCanvas();
         Tree tree = BuildTreeFromCanvas();
         if (tree != null)
         {
             tree.ClearEmptyLists();
             string treeFilePath = NoiseTreeFiles.GetTreeFilePath(sceneCanvasName);
             YamlIO.Save(tree, treeFilePath, null);
         }
     }
     GUILayout.EndHorizontal();
     if (ntf == null)
     {
         ntf = YamlIO.LoadFile <NoiseTreeFiles>(NoiseTreeFiles.GetPath(), null, null);
     }
     if (ntf != null && GUILayout.Button(new GUIContent("Load Tree", "Loads the Canvas from Trees list")))
     {
         GenericMenu genericMenu = new GenericMenu();
         foreach (string tree_file in ntf.tree_files)
         {
             genericMenu.AddItem(new GUIContent(tree_file), false, delegate(object fileName)
             {
                 Load((string)fileName, onComplete);
             }, tree_file);
         }
         genericMenu.Show(lastRectPos.position, 40f);
     }
     if (Event.current.type == EventType.Repaint)
     {
         Rect lastRect = GUILayoutUtility.GetLastRect();
         lastRectPos = new Rect(lastRect.x + 2f, lastRect.yMax + 2f, lastRect.width - 4f, 0f);
     }
 }
Esempio n. 5
0
        public override void Execute(Rect editorRect, Rect precentageRect, Event e, EngineGraph currentGraph)
        {
            base.Execute(editorRect, precentageRect, e, currentGraph);
            if (currentGraph != null)
            {
                if (currentGraph.selectedNode)
                {
                    viewTitle = currentGraph.selectedNode.nodeName;
                }
            }

            else
            {
                _paramAccess = ParamAccessibility.IsGlobal;
            }

            GUILayout.BeginArea(viewRect);

            ShowToolbarGUI();

            GUILayout.BeginArea(new Rect(new Vector2(precentageRect.x, viewRect.y + 8), new Vector2(viewRect.width, 24)));
            GUILayout.BeginHorizontal(_toolbar);

            //Show the menu and add a new parameter.
            if (GUILayout.Button("Add parameter", _button, GUILayout.Width(100)))
            {
                GenericMenu menu = new GenericMenu();

                if (currentGraph == null)
                {
                    menu.AddDisabledItem(new GUIContent("Int"));
                    menu.AddDisabledItem(new GUIContent("Float"));
                    menu.AddDisabledItem(new GUIContent("Bool"));
                    menu.AddDisabledItem(new GUIContent("String"));
                }

                else
                {
                    menu.AddItem(new GUIContent("Int"), false, () => parameters.SuscribeValue($"Parameter {parameters.Count}", ParamVariableType.Int, currentGraph, _paramAccess));
                    menu.AddItem(new GUIContent("Float"), false, () => parameters.SuscribeValue($"Parameter {parameters.Count}", ParamVariableType.Float, currentGraph, _paramAccess));
                    menu.AddItem(new GUIContent("Bool"), false, () => parameters.SuscribeValue($"Parameter {parameters.Count}", ParamVariableType.Bool, currentGraph, _paramAccess));
                    menu.AddItem(new GUIContent("String"), false, () => parameters.SuscribeValue($"Parameter {parameters.Count}", ParamVariableType.String, currentGraph, _paramAccess));
                }

                menu.Show(new Vector2(precentageRect.x + 5, viewRect.y + 14));
            }

            GUILayout.Space(5);
            string accessName = _paramAccess == ParamAccessibility.IsGlobal ? "Global" : "Local";

            //Show the menu and select the parameters of the selected accessibility.
            if (GUILayout.Button(accessName, _button, GUILayout.Width(50)))
            {
                GenericMenu menu = new GenericMenu();

                if (currentGraph == null)
                {
                    menu.AddDisabledItem(new GUIContent("Show Global"));
                    menu.AddDisabledItem(new GUIContent("Show Local"));
                }

                else
                {
                    menu.AddItem(new GUIContent("Show Global"), false, () => _paramAccess = ParamAccessibility.IsGlobal);
                    menu.AddItem(new GUIContent("Show Local"), false, () => _paramAccess  = ParamAccessibility.IsLocal);
                }

                menu.Show(new Vector2(precentageRect.x + 110, viewRect.y + 14));
            }

            GUILayout.FlexibleSpace();
            GUILayout.EndHorizontal();
            GUILayout.EndArea();

            GUILayout.BeginArea(new Rect(precentageRect.x, viewRect.y * 2 + 24, viewRect.width, viewRect.height));
            GUILayout.BeginVertical("BOX");

            var selectedParams = _paramAccess == ParamAccessibility.IsGlobal ? parameters.Where(x => x.access == ParamAccessibility.IsGlobal) :
                                 parameters.Where(x => x.access == ParamAccessibility.IsLocal).Where(x => x.graph == currentGraph);

            if (!selectedParams.Any())
            {
                GUILayout.BeginVertical("BOX");
                GUILayout.Label("Empty", new GUIStyle()
                {
                    alignment = TextAnchor.MiddleCenter,
                    fontStyle = FontStyle.Italic
                });
                GUILayout.EndVertical();
            }

            else
            {
                GUILayout.BeginVertical();
                _pos = GUILayout.BeginScrollView(_pos, GUILayout.Width(viewRect.width));

                foreach (var(Name, Type, Access, Graph, IsPersistent) in selectedParams)
                {
                    GUILayout.Space(5);

                    GUILayout.BeginHorizontal("BOX");

                    GUILayout.BeginVertical();
                    GUILayout.BeginHorizontal();

                    string itemIsPersist;
                    string itemValue;

                    if (Type == ParamVariableType.Int)
                    {
                        var item = parameters.GetInt(Name);
                        itemIsPersist = IsPersistent ? "P: " : "";
                        itemValue     = $"Int: {item.Value}";
                    }

                    else if (Type == ParamVariableType.Float)
                    {
                        var item = parameters.GetFloat(Name);
                        itemIsPersist = IsPersistent ? "P: " : "";
                        itemValue     = $"Float: {item.Value}";
                    }

                    else if (Type == ParamVariableType.String)
                    {
                        var item = parameters.GetString(Name);
                        itemIsPersist = IsPersistent ? "P:" : "";
                        itemValue     = $"String: {item.Value}";
                    }

                    else
                    {
                        var item = parameters.GetBool(Name);
                        itemIsPersist = IsPersistent ? "P: " : "";
                        itemValue     = $"Bool: {item.Value}";
                    }


                    GUILayout.Label($"{itemIsPersist} {Name}");
                    GUILayout.Label(itemValue);

                    GUILayout.EndHorizontal();

                    GUILayout.BeginHorizontal();

                    if (_toDelete && _nameToDelete.Equals(Name))
                    {
                        if (GUILayout.Button("Delete"))
                        {
                            EngineGraphWindow.OnRepaintRequest += () =>
                            {
                                parameters.UnsuscribeValue(_nameToDelete);
                                _nameToDelete = "";
                                AssetDatabase.SaveAssets();
                                AssetDatabase.Refresh();
                            };
                        }

                        if (GUILayout.Button("Cancel"))
                        {
                            _toDelete     = false;
                            _nameToDelete = "";
                        }
                    }

                    else
                    {
                        if (GUILayout.Button("Edit"))
                        {
                            System.Action <string> OnSave = name =>
                            {
                                var editingParam = Name;
                                var editedName   = name;

                                EngineGraphWindow.OnRepaintRequest += () =>
                                {
                                    var graphs = Resources.LoadAll("Data").Select(x => x as EngineGraph).Where(x => x != null);

                                    if (graphs.Any())
                                    {
                                        foreach (var item in graphs)
                                        {
                                            var checkCondition = item.nodes.Where(x => x.nodeType == EnumNodeType.Condition);

                                            if (checkCondition.Any())
                                            {
                                                var conditions = checkCondition.Select(x => (NCondition)x)
                                                                 .Where(x => x.data.Contains(editingParam));

                                                foreach (var node in conditions)
                                                {
                                                    node.data.UpdateName(editingParam, editedName);
                                                    EditorUtility.SetDirty(node);
                                                }
                                            }


                                            var checkSetter = item.nodes.Where(x => x.nodeType == EnumNodeType.Set_Param);

                                            if (checkSetter.Any())
                                            {
                                                var setters = checkSetter.Select(x => (NSetParam)x)
                                                              .Where(x => x.data.Any(y => y.Name == editingParam));

                                                foreach (var node in setters)
                                                {
                                                    node.data.UpdateName(editingParam, editedName);
                                                    EditorUtility.SetDirty(node);
                                                }
                                            }
                                        }
                                    }

                                    AssetDatabase.SaveAssets();
                                    AssetDatabase.Refresh();
                                };
                            };

                            if (Type == ParamVariableType.Int)
                            {
                                EditVariablePopupWindow.InitContainerPopup(parameters.GetInt(Name), OnSave);
                            }
                            else if (Type == ParamVariableType.Float)
                            {
                                EditVariablePopupWindow.InitContainerPopup(parameters.GetFloat(Name), OnSave);
                            }
                            else if (Type == ParamVariableType.Bool)
                            {
                                EditVariablePopupWindow.InitContainerPopup(parameters.GetBool(Name), OnSave);
                            }
                            else
                            {
                                EditVariablePopupWindow.InitContainerPopup(parameters.GetString(Name), OnSave);
                            }
                        }

                        if (GUILayout.Button("Delete"))
                        {
                            _toDelete     = true;
                            _nameToDelete = Name;
                        }
                    }

                    GUILayout.EndHorizontal();

                    GUILayout.EndVertical();

                    GUILayout.EndHorizontal();

                    GUILayout.Space(5);
                }

                GUILayout.Space(30);

                GUILayout.EndVertical();
                GUILayout.EndScrollView();
            }


            GUILayout.EndVertical();
            GUILayout.EndArea();

            GUILayout.EndArea();
        }
Esempio n. 6
0
        public override void Execute(Rect editorRect, Rect precentageRect, Event e, EngineGraph currentGraph)
        {
            _textStyle = new GUIStyle(GUI.skin.label)
            {
                fontSize  = 12,
                alignment = TextAnchor.UpperCenter,
                onNormal  = new GUIStyleState()
                {
                    textColor = Color.white
                }
            };

            base.Execute(editorRect, precentageRect, e, currentGraph);
            _style = new GUIStyle(GUI.skin.box);

            ShowCreatePanelGUI();
            GUILayout.BeginHorizontal(_toolbar);

            if (GUILayout.Button("File", _dropdown, GUILayout.Width(50)))
            {
                GenericMenu menu = new GenericMenu();

                menu.AddItem(new GUIContent("Create Graph"), false, () => showDialogue = true);
                menu.AddItem(new GUIContent("Load Graph"), false, EngineGraphEditorUtilities.LoadGraph);

                menu.AddSeparator("");

                if (currentGraph == null)
                {
                    menu.AddDisabledItem(new GUIContent("Unload Graph"));
                    menu.AddDisabledItem(new GUIContent("Delete Graph"));
                }

                else
                {
                    currentGraph.selectedNode = null;

                    menu.AddItem(new GUIContent("Delete Graph/Confirm"), false, EngineGraphEditorUtilities.DeleteGraph);
                    menu.AddItem(new GUIContent("Unload Graph"), false, EngineGraphEditorUtilities.UnloadGraph);
                }

                menu.Show(new Vector2(5, 17));
            }

            GUILayout.Space(10);

            if (GUILayout.Button("Insert", _dropdown, GUILayout.Width(100)))
            {
                GenericMenu menu = new GenericMenu();

                if (currentGraph != null)
                {
                    currentGraph.selectedNode = null;

                    menu.AddItem(new GUIContent("Story State/Add Text State", "Write dialogues and narrative text in the text container."), false, () => EngineGraphEditorUtilities.CreateNode(currentGraph, EnumNodeType.Text, new Vector2(50, 50)));
                    menu.AddItem(new GUIContent("Story State/Add Clear Text State"), false, () => EngineGraphEditorUtilities.CreateNode(currentGraph, EnumNodeType.Clear, new Vector2(50, 50)));
                    menu.AddItem(new GUIContent("Story State/Add Change Flow Chart State"), false, () => EngineGraphEditorUtilities.CreateNode(currentGraph, EnumNodeType.Change_Flow_Chart, new Vector2(50, 50)));
                    menu.AddItem(new GUIContent("Character State/Add Show Character State"), false, () => EngineGraphEditorUtilities.CreateNode(currentGraph, EnumNodeType.Show_Character, new Vector2(50, 50)));
                    menu.AddItem(new GUIContent("Character State/Add Hide Character State"), false, () => EngineGraphEditorUtilities.CreateNode(currentGraph, EnumNodeType.Hide_Character, new Vector2(50, 50)));
                    menu.AddItem(new GUIContent("Character State/Add Change Character Sprite State"), false, () => EngineGraphEditorUtilities.CreateNode(currentGraph, EnumNodeType.Change_Character_Sprite, new Vector2(50, 50)));
                    menu.AddItem(new GUIContent("Character State/Add Character Move State"), false, () => EngineGraphEditorUtilities.CreateNode(currentGraph, EnumNodeType.Move_Character, new Vector2(50, 50)));
                    menu.AddItem(new GUIContent("Image State/Add Change Background State"), false, () => EngineGraphEditorUtilities.CreateNode(currentGraph, EnumNodeType.Change_Background, new Vector2(50, 50)));
                    menu.AddItem(new GUIContent("Effect State/Add Delay State"), false, () => EngineGraphEditorUtilities.CreateNode(currentGraph, EnumNodeType.Delay, new Vector2(50, 50)));
                    menu.AddItem(new GUIContent("Effect State/Add Show Text Container"), false, () => EngineGraphEditorUtilities.CreateNode(currentGraph, EnumNodeType.Show_Text_Container, new Vector2(50, 50)));
                    menu.AddItem(new GUIContent("Effect State/Add Hide Text Container"), false, () => EngineGraphEditorUtilities.CreateNode(currentGraph, EnumNodeType.Hide_Text_Container, new Vector2(50, 50)));
                    menu.AddItem(new GUIContent("Sound State/Music/Add Play Music State"), false, () => EngineGraphEditorUtilities.CreateNode(currentGraph, EnumNodeType.Play_Music, new Vector2(50, 50)));
                    menu.AddItem(new GUIContent("Sound State/Music/Add Stop Music State"), false, () => EngineGraphEditorUtilities.CreateNode(currentGraph, EnumNodeType.Stop_Music, new Vector2(50, 50)));
                    menu.AddItem(new GUIContent("Sound State/Sound FX/Add Play Sound State"), false, () => EngineGraphEditorUtilities.CreateNode(currentGraph, EnumNodeType.Play_Sound, new Vector2(50, 50)));
                    menu.AddItem(new GUIContent("Sound State/Sound FX/Add Stop SouSoundnd State"), false, () => EngineGraphEditorUtilities.CreateNode(currentGraph, EnumNodeType.Stop_Sound, new Vector2(50, 50)));
                    menu.AddItem(new GUIContent("Sound State/Voice/Add Play Voice State"), false, () => EngineGraphEditorUtilities.CreateNode(currentGraph, EnumNodeType.Play_Voice, new Vector2(50, 50)));
                    menu.AddItem(new GUIContent("Sound State/Voice/Add Stop Voice State"), false, () => EngineGraphEditorUtilities.CreateNode(currentGraph, EnumNodeType.Stop_Voice, new Vector2(50, 50)));
                    menu.AddItem(new GUIContent("Branch State/Add Question Branch State"), false, () => EngineGraphEditorUtilities.CreateNode(currentGraph, EnumNodeType.Branch_Question, new Vector2(50, 50)));
                    menu.AddItem(new GUIContent("Branch State/Add Conditional Branch State"), false, () => EngineGraphEditorUtilities.CreateNode(currentGraph, EnumNodeType.Branch_Condition, new Vector2(50, 50)));
                    menu.AddSeparator("Branch State/");
                    menu.AddItem(new GUIContent("Branch State/Add Answer State"), false, () => EngineGraphEditorUtilities.CreateNode(currentGraph, EnumNodeType.Answer, new Vector2(50, 50)));
                    menu.AddItem(new GUIContent("Branch State/Add Condition State"), false, () => EngineGraphEditorUtilities.CreateNode(currentGraph, EnumNodeType.Condition, new Vector2(50, 50)));
                    menu.AddItem(new GUIContent("System State/Add Set Parameter State"), false, () => EngineGraphEditorUtilities.CreateNode(currentGraph, EnumNodeType.Set_Param, new Vector2(50, 50)));
                    menu.AddItem(new GUIContent("System State/Add Trigger Event State"), false, () => EngineGraphEditorUtilities.CreateNode(currentGraph, EnumNodeType.Set_Param, new Vector2(50, 50)));
                }

                else
                {
                    menu.AddDisabledItem(new GUIContent("Story State/Add Text State"));
                    menu.AddDisabledItem(new GUIContent("Story State/Add Clear Text State"));
                    menu.AddDisabledItem(new GUIContent("Story State/Add Change Flow Chart State"));
                    menu.AddDisabledItem(new GUIContent("Character State/Add Show Character State"));
                    menu.AddDisabledItem(new GUIContent("Character State/Add Hide Character State"));
                    menu.AddDisabledItem(new GUIContent("Character State/Add Change Character Sprite State"));
                    menu.AddDisabledItem(new GUIContent("Character State/Add Character Move State"));
                    menu.AddDisabledItem(new GUIContent("Image State/Add Change Background State"));
                    menu.AddDisabledItem(new GUIContent("Effect State/Add Delay State"));
                    menu.AddDisabledItem(new GUIContent("Effect State/Add Show Text Container"));
                    menu.AddDisabledItem(new GUIContent("Effect State/Add Hide Text Container"));
                    menu.AddDisabledItem(new GUIContent("Sound State/Music/Add Play Music State"));
                    menu.AddDisabledItem(new GUIContent("Sound State/Music/Add Stop Music State"));
                    menu.AddDisabledItem(new GUIContent("Sound State/Sound FX/Add Play Sound State"));
                    menu.AddDisabledItem(new GUIContent("Sound State/Sound FX/Add Stop Sound State"));
                    menu.AddDisabledItem(new GUIContent("Sound State/Voice/Add Play Voice State"));
                    menu.AddDisabledItem(new GUIContent("Sound State/Voice/Add Stop Voice State"));
                    menu.AddDisabledItem(new GUIContent("Branch State/Add Question Branch State"));
                    menu.AddDisabledItem(new GUIContent("Branch State/Add Conditional Brach State"));
                    menu.AddSeparator("Branch State/");
                    menu.AddDisabledItem(new GUIContent("Branch State/Add Answer State"));
                    menu.AddDisabledItem(new GUIContent("Branch State/Add Condition State"));
                    menu.AddDisabledItem(new GUIContent("System State/Add Set Parameter State"));
                    menu.AddDisabledItem(new GUIContent("System State/Add Trigger Event State"));
                }

                menu.Show(new Vector2(65, 17));
            }

            if (GUILayout.Button("Tools", _dropdown, GUILayout.Width(80)))
            {
                GenericMenu menu = new GenericMenu();

                //menu.AddDisabledItem(new GUIContent("Import/XML"));
                //menu.AddDisabledItem(new GUIContent("Import/TXT"));
                //menu.AddDisabledItem(new GUIContent("Export/XML"));
                //menu.AddDisabledItem(new GUIContent("Export/TXT"));
                menu.AddItem(new GUIContent("Clear cache", "Clear the cache information of the last session."), false, EngineGraphCacheUtilities.ClearSessionCache);

                menu.Show(new Vector2(135, 17));
            }

            GUILayout.FlexibleSpace();

            GUILayout.EndHorizontal();

            if (showDialogue)
            {
                CreateGraphDialogueGUI();
            }
        }
Esempio n. 7
0
        void ProcessContextMenu(Event e, int contextID)
        {
            GenericMenu menu = new GenericMenu();

            if (contextID == 0)
            {
                menu.AddItem(new GUIContent("Create Graph"), false, EngineGraphEditorUtilities.OpenNewGraphPanel);
                menu.AddItem(new GUIContent("Load Graph"), false, EngineGraphEditorUtilities.LoadGraph);

                if (currentGraph != null)
                {
                    menu.AddSeparator("");
                    menu.AddItem(new GUIContent("Unload Graph"), false, EngineGraphEditorUtilities.UnloadGraph);
                    menu.AddSeparator("");
                    menu.AddItem(new GUIContent("Story State/Add Text State"), false, () => EngineGraphEditorUtilities.CreateNode(currentGraph, EnumNodeType.Text, mousePos));
                    menu.AddItem(new GUIContent("Story State/Add Clear Text State"), false, () => EngineGraphEditorUtilities.CreateNode(currentGraph, EnumNodeType.Clear, mousePos));
                    menu.AddItem(new GUIContent("Story State/Add Change Flow Chart State"), false, () => EngineGraphEditorUtilities.CreateNode(currentGraph, EnumNodeType.Change_Flow_Chart, mousePos));
                    menu.AddItem(new GUIContent("Character State/Add Show Character State"), false, () => EngineGraphEditorUtilities.CreateNode(currentGraph, EnumNodeType.Show_Character, mousePos));
                    menu.AddItem(new GUIContent("Character State/Add Hide Character State"), false, () => EngineGraphEditorUtilities.CreateNode(currentGraph, EnumNodeType.Hide_Character, mousePos));
                    menu.AddItem(new GUIContent("Character State/Add Change Character Sprite State"), false, () => EngineGraphEditorUtilities.CreateNode(currentGraph, EnumNodeType.Change_Character_Sprite, mousePos));
                    menu.AddItem(new GUIContent("Character State/Add Move Character State"), false, () => EngineGraphEditorUtilities.CreateNode(currentGraph, EnumNodeType.Move_Character, mousePos));
                    menu.AddItem(new GUIContent("Image State/Add Change Background State"), false, () => EngineGraphEditorUtilities.CreateNode(currentGraph, EnumNodeType.Change_Background, mousePos));
                    menu.AddItem(new GUIContent("Effect State/Add Delay State"), false, () => EngineGraphEditorUtilities.CreateNode(currentGraph, EnumNodeType.Delay, mousePos));
                    menu.AddItem(new GUIContent("Effect State/Add Show Text Container"), false, () => EngineGraphEditorUtilities.CreateNode(currentGraph, EnumNodeType.Show_Text_Container, mousePos));
                    menu.AddItem(new GUIContent("Effect State/Add Hide Text Container"), false, () => EngineGraphEditorUtilities.CreateNode(currentGraph, EnumNodeType.Hide_Text_Container, mousePos));
                    menu.AddItem(new GUIContent("Sound State/Music/Add Play Music State"), false, () => EngineGraphEditorUtilities.CreateNode(currentGraph, EnumNodeType.Play_Music, mousePos));
                    menu.AddItem(new GUIContent("Sound State/Music/Add Stop Music State"), false, () => EngineGraphEditorUtilities.CreateNode(currentGraph, EnumNodeType.Stop_Music, mousePos));
                    menu.AddItem(new GUIContent("Sound State/Sound FX/Add Play Sound State"), false, () => EngineGraphEditorUtilities.CreateNode(currentGraph, EnumNodeType.Play_Sound, mousePos));
                    menu.AddItem(new GUIContent("Sound State/Sound FX/Add Stop Sound State"), false, () => EngineGraphEditorUtilities.CreateNode(currentGraph, EnumNodeType.Stop_Sound, mousePos));
                    menu.AddItem(new GUIContent("Sound State/Voice/Add Play Voice State"), false, () => EngineGraphEditorUtilities.CreateNode(currentGraph, EnumNodeType.Play_Voice, mousePos));
                    menu.AddItem(new GUIContent("Sound State/Voice/Add Stop Voice State"), false, () => EngineGraphEditorUtilities.CreateNode(currentGraph, EnumNodeType.Stop_Voice, mousePos));
                    menu.AddItem(new GUIContent("Branch State/Add Question Branch State"), false, () => EngineGraphEditorUtilities.CreateNode(currentGraph, EnumNodeType.Branch_Question, mousePos));
                    menu.AddItem(new GUIContent("Branch State/Add Conditional Branch State"), false, () => EngineGraphEditorUtilities.CreateNode(currentGraph, EnumNodeType.Branch_Condition, mousePos));
                    menu.AddSeparator("Branch State/");
                    menu.AddItem(new GUIContent("Branch State/Add Answer State"), false, () => EngineGraphEditorUtilities.CreateNode(currentGraph, EnumNodeType.Answer, mousePos));
                    menu.AddItem(new GUIContent("Branch State/Add Condition State"), false, () => EngineGraphEditorUtilities.CreateNode(currentGraph, EnumNodeType.Condition, mousePos));
                    menu.AddItem(new GUIContent("System State/Add Set Parameter State"), false, () => EngineGraphEditorUtilities.CreateNode(currentGraph, EnumNodeType.Set_Param, mousePos));
                    menu.AddItem(new GUIContent("System State/Add Trigger Event State"), false, () => EngineGraphEditorUtilities.CreateNode(currentGraph, EnumNodeType.Trigger_Event, mousePos));
                }
            }

            if (contextID == 1)
            {
                if (currentGraph != null)
                {
                    menu.AddItem(new GUIContent("Delete State"), false, () => EngineGraphEditorUtilities.DeleteNode(currentGraph, overNodeID));
                    menu.AddItem(new GUIContent("Disconnect/Disconnect Input"), false, () => EngineGraphEditorUtilities.DisconnectInput(currentGraph, overNodeID));
                    menu.AddItem(new GUIContent("Disconnect/Disconnect Output"), false, () => EngineGraphEditorUtilities.DisconnectOutput(currentGraph, overNodeID));
                    menu.AddItem(new GUIContent("Disconnect/Disconnect All"), false, () => EngineGraphEditorUtilities.DisconnectAll(currentGraph, overNodeID));
                }
            }
            if (contextID == 2)
            {
                if (currentGraph != null)
                {
                    menu.AddItem(new GUIContent("Disconnect Output"), false, () => EngineGraphEditorUtilities.DisconnectOutput(currentGraph, overNodeID));
                }
            }
            if (contextID == 3)
            {
                if (currentGraph != null)
                {
                    menu.AddItem(new GUIContent("Disconnect Input"), false, () => EngineGraphEditorUtilities.DisconnectInput(currentGraph, overNodeID));
                }
            }
            if (contextID == 4)
            {
                if (currentGraph != null)
                {
                    menu.AddItem(new GUIContent("Delete State"), false, () => EngineGraphEditorUtilities.DeleteNode(currentGraph, overNodeID));
                    menu.AddItem(new GUIContent("Disconnect Input"), false, () => EngineGraphEditorUtilities.DisconnectInput(currentGraph, overNodeID));
                }
            }

            OnShowMenu += () =>
            {
                menu.Show(_fixedMousePose);
                e.Use();
            };
        }