Ejemplo n.º 1
0
 public override void Undo()
 {
     if (CanUndo)
     {
         var node = m_graph.GetNodeByHash(m_nodeHash);
         m_endPosition      = node.Node.Position;
         node.Node.Position = m_startPosition;
     }
 }
Ejemplo n.º 2
0
        public override void Undo()
        {
            if (CanUndo)
            {
                BTEditorGraphNode createdNode = m_graph.GetNodeByHash(m_createdNodeHash);

                m_parentNodeHash = m_graph.GetNodeHash(createdNode.Parent);
                m_serializedNode = BTUtils.SerializeNode(createdNode.Node);

                createdNode.OnDelete();
                m_createdNodeHash = null;
            }
        }
Ejemplo n.º 3
0
        public override void Undo()
        {
            if (CanUndo)
            {
                BehaviourNode node = BTUtils.DeserializeNode(m_serializedNode);
                if (m_childIndex >= 0)
                {
                    var parentNode  = m_graph.GetNodeByHash(m_parentNodeHash);
                    var createdNode = parentNode.OnInsertChild(m_childIndex, node);
                    m_createdNodeHash = m_graph.GetNodeHash(createdNode);
                }
                else
                {
                    var parentNode  = m_graph.GetNodeByHash(m_parentNodeHash);
                    var createdNode = parentNode.OnCreateChild(node);
                    m_createdNodeHash = m_graph.GetNodeHash(createdNode);
                }

                m_parentNodeHash = null;
                m_serializedNode = null;
            }
        }
Ejemplo n.º 4
0
        public override void Redo()
        {
            BTEditorGraphNode node = m_graph.GetNodeByHash(m_nodeGroupHash);

            m_graph.IncreaseEditingDepth(node);
        }