Exemplo n.º 1
0
        private void SelectBranchRecursive(BTEditorGraphNode node)
        {
            m_selection.Add(node);
            node.OnSelected();

            for (int i = 0; i < node.ChildCount; i++)
            {
                SelectBranchRecursive(node.GetChild(i));
            }
        }
Exemplo n.º 2
0
 private void DeleteBreakpointsRecursive(BTEditorGraphNode node)
 {
     if (node != null && node.Node != null)
     {
         node.Node.Breakpoint = Breakpoint.None;
         for (int i = 0; i < node.ChildCount; i++)
         {
             DeleteBreakpointsRecursive(node.GetChild(i));
         }
     }
 }
Exemplo n.º 3
0
 private void MoveNonSelectedChildren(BTEditorGraphNode node, Vector2 delta)
 {
     for (int i = 0; i < node.ChildCount; i++)
     {
         var child = node.GetChild(i);
         if (m_selection.IndexOf(child) < 0)
         {
             child.NodePositon = child.NodePositon + delta;
             MoveNonSelectedChildren(child, delta);
         }
     }
 }
Exemplo n.º 4
0
 public void OnNodeDeleteChildren(BTEditorGraphNode node)
 {
     if (node != null)
     {
         BTUndoSystem.BeginUndoGroup("Delete children");
         int childIndex = 0;
         while (node.ChildCount > 0)
         {
             BTUndoSystem.RegisterUndo(new UndoNodeDeleted(node.GetChild(0), childIndex));
             node.OnDeleteChild(0);
             childIndex++;
         }
         BTUndoSystem.EndUndoGroup();
     }
 }
Exemplo n.º 5
0
        public BTEditorGraphNode GetNodeByHash(string path)
        {
            byte[] actualPath = Convert.FromBase64String(path);
            if (actualPath != null)
            {
                BTEditorGraphNode node = m_masterRoot;

                for (int i = 0; i < actualPath.Length; i++)
                {
                    node = node.GetChild(actualPath[i]);
                    if (node == null)
                    {
                        return(null);
                    }
                }

                return(node);
            }

            return(null);
        }