Exemplo n.º 1
0
        public void DeleteContext(BehaviourNode node)
        {
            if (node == null)
            {
                return;
            }
            var t = node.GetContext();

            if (t != null)
            {
                mAssetBinder.targetTree.EditorDeleteNode(t);
                if (t.Asset is BTNodeAsset)
                {
                    AddDelayTask(ACT_UPDATE_WIRES, mWires.UpdateWires);
                }
                if (node != RootNode && node.GetNode() == null)
                {
                    AIGraph.RemoveElement(node);
                }
                else
                {
                    node.Resize();
                }
            }
        }
Exemplo n.º 2
0
        void DisplayEditMenu(Rect pos)
        {
            BTEditorMenu menu;

            if (mAssetBinder.targetTree == null)
            {
                menu = sNewTreeMenu;
            }
            else if (mContextNode == null || mContextNode.GetContext() == null)
            {
                menu = sTreeMenu;
            }
            else if (mContextNode.GetContext().isCondition)
            {
                menu = sConditionMenu;
            }
            else
            {
                menu = sContextMenu;
            }
            menu.Display(this, pos);
        }