private void ShowNodeContextMenu(ActionGraphEditorNode node)
        {
            GenericMenu menu = new GenericMenu();

            // ToDo: disconnection per row
            // ToDo: special entries
            if (node.connectedTo.Any())
            {
                foreach (var info in node.connectedTo)
                {
                    menu.AddItem
                    (
                        new GUIContent($"Disconnect.../{info.Target.Owner.UniqueName}"),
                        false,
                        () => View.DisconnectNodes(info)
                    );
                }
            }
            else
            {
                menu.AddDisabledItem(new GUIContent("Disconnect..."));
            }

            menu.AddItem(new GUIContent("Delete"), false, () => View.DeleteNode(node));

            menu.ShowAsContext();
        }
Ejemplo n.º 2
0
        private void ShowNodeContextMenu(ActionGraphEditorNode node)
        {
            GenericMenu menu = new GenericMenu();

            if (node.connectedTo.Any())
            {
                foreach (var info in node.connectedTo)
                {
                    menu.AddItem
                    (
                        new GUIContent($"Disconnect.../{info.Node.UniqueName}"),
                        false,
                        () => View.DisconnectNodes(node, info.Node as ActionGraphEditorNode)
                    );
                }
            }
            else
            {
                menu.AddDisabledItem(new GUIContent("Disconnect..."));
            }

            menu.AddItem(new GUIContent("Delete"), false, () => View.DeleteNode(node));

            menu.ShowAsContext();
        }