Exemplo n.º 1
0
        public void AddNewNode(AIModules.Module mod, BTNode context, Vector2 contextPos)
        {
            var todo = BTEditableDO.New <BTAddNode>(this);

            todo.context  = context;
            todo.position = contextPos;
            todo.mod      = mod;
            DoEdit(todo);
        }
Exemplo n.º 2
0
        public void DeleteSelections()
        {
            var del = BTEditableDO.New <BTDeleteNode>(this);

            del.SetSelection(SelectionNodes);
            mSelection.Clear();
            mSelectionAssets.Clear();
            DoEdit(del);
        }
        public override void ModifyParentAs(BehaviourNode node)
        {
            base.ModifyParentAs(node);
            var todo = BTEditableDO.New <BTModifyParent>(editor);

            todo.isParentRoot = node == editor.RootNode;
            todo.child        = mNode;
            todo.parent       = node == null ? null : node.GetNode();
            editor.DoEdit(todo);
        }
Exemplo n.º 4
0
 public void CopySelection()
 {
     if (mSelection.Count == 0 && RaycastNode != null)
     {
         mSelection.Add(RaycastNode);
     }
     if (mSelection.Count == 0)
     {
         return;
     }
     if (mCopyDo == null)
     {
         mCopyDo = BTEditableDO.New <BTCopy>(this);
     }
     mCopyDo.SetSelection(mSelection);
 }
Exemplo n.º 5
0
 public void DoEdit(BTEditableDO todo)
 {
     if (Application.isPlaying || todo == null)
     {
         return;
     }
     AddDelayTask(ACT_EDIT_DO, () => {
         if (todo.DoEditWithUndo())
         {
             mUndoStack.Add(todo);
             if (mUndoStack.Count > 100)
             {
                 mUndoStack.RemoveAt(0);
             }
         }
     });
 }