Inheritance: SA.BehaviorEditor.DrawNode
コード例 #1
0
        void ModifyNode(Event e)
        {
            GenericMenu menu = new GenericMenu();

            if (selectedNode.drawNode == null)
            {
                return;
            }
            if (selectedNode.drawNode is StateNode)
            {
                StateNode stateNode = (StateNode)selectedNode.drawNode;
                if (stateNode != null)
                {
                    menu.AddSeparator("");
                    menu.AddItem(new GUIContent("Add Condition"), false, ContextCallback, UserActions.addTransitionNode);
                }
                else
                {
                    menu.AddSeparator("");
                    menu.AddDisabledItem(new GUIContent("Add Condition"));
                }
                menu.AddSeparator("");
                menu.AddItem(new GUIContent("Delete"), false, ContextCallback, UserActions.deleteNode);
            }
            if (selectedNode.drawNode is PortalNode)
            {
                PortalNode portalNode = (PortalNode)selectedNode.drawNode;
                menu.AddSeparator("");
                menu.AddItem(new GUIContent("Delete"), false, ContextCallback, UserActions.deleteNode);
            }
            if (selectedNode.drawNode is CommentNode)
            {
                menu.AddSeparator("");
                menu.AddItem(new GUIContent("Delete"), false, ContextCallback, UserActions.deleteNode);
            }
            if (selectedNode.drawNode is TransitionNode)
            {
                if (selectedNode.isDuplicate || !selectedNode.isAssigned)
                {
                    menu.AddSeparator("");
                    menu.AddDisabledItem(new GUIContent("Make Transition"));
                }
                else
                {
                    menu.AddSeparator("");
                    menu.AddItem(new GUIContent("Make Transition"), false, ContextCallback, UserActions.makeTransition);
                }
                menu.AddSeparator("");
                menu.AddItem(new GUIContent("Delete"), false, ContextCallback, UserActions.deleteNode);
            }
            menu.ShowAsContext();
            e.Use();
        }
コード例 #2
0
ファイル: TransitionNode.cs プロジェクト: BottomTrap/pfe-game
 public void Init(StateNode enterState, Transition transition)
 {
     //      this.enterState = enterState;
 }