private void ShowEditMenu(ChoiceData choice, int index)
        {
            GUI.FocusControl(null);
            var menu = new GenericMenu();

            menu.AddItem(new GUIContent("View"), false, () => {
                Selection.activeObject = choice;
            });

            menu.AddItem(new GUIContent("Move Up"), false, () => {
                _callbacks.Push(() => {
                    MoveChoice(choice, index, -1);
                    DialogueWindow.SaveGraph();
                });
            });

            menu.AddItem(new GUIContent("Move Down"), false, () => {
                _callbacks.Push(() => {
                    MoveChoice(choice, index, 1);
                    DialogueWindow.SaveGraph();
                });
            });

            menu.AddSeparator("");

            menu.AddItem(new GUIContent("Delete"), false, () => {
                _graveyard.Add(_data.choices[index]);
            });

            menu.ShowAsContext();
        }
Пример #2
0
        public void ShowContextMenu()
        {
            if (Type == ConnectionType.In)
            {
                return;
            }

            var menu = new GenericMenu();

            menu.AddItem(
                new GUIContent("Clear Connections"), false, () => {
                Undo.RecordObject(_childCollection as Object, "Clear connections");
                Links.ClearAllLinks();
                _childCollection.ClearConnectionChildren();
                DialogueWindow.SaveGraph();
            });
            menu.ShowAsContext();
        }