Exemple #1
0
        public void IncremenentGraphUndoRedoState(VFXModel model, VFXModel.InvalidationCause cause)
        {
            if (cause == VFXModel.InvalidationCause.kParamChanged && model is VFXSlot)
            {
                m_graphUndoStack.AddSlotDelta(model as VFXSlot);
                return;
            }

            if (cause == VFXModel.InvalidationCause.kExpressionInvalidated ||   // Ignore invalidation which doesn't modify model
                cause == VFXModel.InvalidationCause.kExpressionGraphChanged)
            {
                return;
            }

            if (m_reentrant)
            {
                m_reentrant = false;
                throw new InvalidOperationException("Reentrant undo/redo, this is not supposed to happen!");
            }

            if (m_graphUndoStack != null)
            {
                if (m_graphUndoStack == null)
                {
                    Debug.LogError("Unexpected IncrementGraphState (not initialize)");
                    return;
                }

                m_graphUndoStack.IncrementGraphState();
            }
        }
Exemple #2
0
        public void IncremenentGraphUndoRedoState(VFXModel model, VFXModel.InvalidationCause cause)
        {
            if (cause == VFXModel.InvalidationCause.kParamChanged && model is VFXSlot)
            {
                m_graphUndoStack.AddSlotDelta(model as VFXSlot);
                return;
            }

            if (cause != VFXModel.InvalidationCause.kStructureChanged &&
                cause != VFXModel.InvalidationCause.kConnectionChanged &&
                cause != VFXModel.InvalidationCause.kParamChanged &&
                cause != VFXModel.InvalidationCause.kSettingChanged &&
                cause != VFXModel.InvalidationCause.kUIChanged)
            {
                return;
            }

            if (m_reentrant)
            {
                m_reentrant = false;
                throw new InvalidOperationException("Reentrant undo/redo, this is not supposed to happen!");
            }

            if (m_graphUndoStack != null)
            {
                if (m_graphUndoStack == null)
                {
                    Debug.LogError("Unexpected IncrementGraphState (not initialize)");
                    return;
                }

                m_graphUndoStack.IncrementGraphState();
            }
        }