Exemplo n.º 1
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.º 2
0
        void UpdateTreeGraph()
        {
            mCopyDo = null;
            AddHistory(mAssetBinder.source);
            mBindStack.Clear();
            mUndoStack.Clear();
            AIGraph.ClearElements();
            mContextNode = null;
            RaycastNode  = null;
            RequestChild(null);

            if (Application.isPlaying)
            {
                var bind = mAssetBinder.RuntimeBinder;
                while (bind != null)
                {
                    mBindStack.Insert(0, bind);
                    bind = bind.Parent;
                }
            }
            AIGraph.AddElement(RootNode);
            if (mAssetBinder.targetTree != null)
            {
                List <BTNode> datas = new List <BTNode>();
                mAssetBinder.targetTree.GetAllNodes(datas);
                foreach (var t in datas)
                {
                    if (t.Asset == null)
                    {
                        mAssetBinder.targetTree.EditorDeleteNode(t);
                        continue;
                    }
                    if (t.Asset is BTNodeAsset)
                    {
                        var node = new BTNodeGUI(this, t);
                        AIGraph.AddElement(node);
                    }
                }
            }
            RootNode.Resize();
            mWires.UpdateWires();
            var runner = TargetRunner;

            BlackboardMonitor.Visible    = runner != null && Application.isPlaying;
            BlackboardMonitor.Blackboard = runner == null ? null : runner.Blackboard;
        }