Пример #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;
     }
 }
Пример #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;
            }
        }
Пример #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;
            }
        }
Пример #4
0
        public override void Redo()
        {
            BTEditorGraphNode node = m_graph.GetNodeByHash(m_nodeGroupHash);

            m_graph.IncreaseEditingDepth(node);
        }