Ejemplo n.º 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();
            }
        }
Ejemplo n.º 2
0
        protected override void OnInvalidate(VFXModel model, VFXModel.InvalidationCause cause)
        {
            m_saved = false;
            base.OnInvalidate(model, cause);

            if (model is VFXParameter || model is VFXSlot && (model as VFXSlot).owner is VFXParameter)
            {
                BuildParameterInfo();
            }

            if (cause == VFXModel.InvalidationCause.kStructureChanged)
            {
                UpdateSubAssets();
            }

            if (cause != VFXModel.InvalidationCause.kExpressionInvalidated &&
                cause != VFXModel.InvalidationCause.kExpressionGraphChanged)
            {
                EditorUtility.SetDirty(this);
            }

            if (cause == VFXModel.InvalidationCause.kExpressionGraphChanged)
            {
                m_ExpressionGraphDirty = true;
                m_DependentDirty       = true;
            }

            if (cause == VFXModel.InvalidationCause.kParamChanged)
            {
                m_ExpressionValuesDirty = true;
                m_DependentDirty        = true;
            }
        }
Ejemplo n.º 3
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();
            }
        }
Ejemplo n.º 4
0
        protected override void OnInvalidate(VFXModel model, VFXModel.InvalidationCause cause)
        {
            m_saved = false;

            if (cause == VFXModel.InvalidationCause.kStructureChanged ||
                cause == VFXModel.InvalidationCause.kSettingChanged ||
                cause == VFXModel.InvalidationCause.kConnectionChanged)
            {
                m_SystemNames.Sync(this);
            }

            base.OnInvalidate(model, cause);

            if (model is VFXParameter ||                              //Something changed directly on VFXParameter (e.g. exposed state boolean)
                model is VFXSlot && (model as VFXSlot).owner is VFXParameter || //Something changed on a slot owned by a VFXParameter (e.g. the default value)
                cause == VFXModel.InvalidationCause.kStructureChanged //A VFXParameter could have been removed
                )
            {
                BuildParameterInfo();
            }


            if (cause == VFXModel.InvalidationCause.kStructureChanged)
            {
                UpdateSubAssets();
                if (model == this)
                {
                    VFXSubgraphContext.CallOnGraphChanged(this);
                }

                m_DependentDirty = true;
            }

            if (cause == VFXModel.InvalidationCause.kSettingChanged && model is VFXParameter)
            {
                VFXSubgraphContext.CallOnGraphChanged(this);
                m_DependentDirty = true;
            }

            if (cause != VFXModel.InvalidationCause.kExpressionInvalidated &&
                cause != VFXModel.InvalidationCause.kExpressionGraphChanged &&
                cause != VFXModel.InvalidationCause.kUIChangedTransient &&
                (model.hideFlags & HideFlags.DontSave) == 0)
            {
                EditorUtility.SetDirty(this);
            }

            if (cause == VFXModel.InvalidationCause.kExpressionGraphChanged)
            {
                m_ExpressionGraphDirty = true;
                m_DependentDirty       = true;
            }

            if (cause == VFXModel.InvalidationCause.kParamChanged)
            {
                m_ExpressionValuesDirty = true;
                m_DependentDirty        = true;
            }
        }
Ejemplo n.º 5
0
        protected override void OnInvalidate(VFXModel model, VFXModel.InvalidationCause cause)
        {
            if (model == this && cause == VFXModel.InvalidationCause.kSettingChanged)
            {
                ((VFXDataParticle)GetData()).capacity = capacity;
            }

            base.OnInvalidate(model, cause);
        }
Ejemplo n.º 6
0
        protected override void OnInvalidate(VFXModel model, VFXModel.InvalidationCause cause)
        {
            if (model == this && cause == VFXModel.InvalidationCause.kSettingChanged)
            {
                ((VFXDataMesh)GetData()).shader = shader;
            }

            base.OnInvalidate(model, cause);
        }
Ejemplo n.º 7
0
        protected override void OnInvalidate(VFXModel model, VFXModel.InvalidationCause cause)
        {
            m_saved = false;

            if (cause == VFXModel.InvalidationCause.kStructureChanged || cause == VFXModel.InvalidationCause.kSettingChanged)
            {
                m_SystemNames.Sync(this);
            }

            base.OnInvalidate(model, cause);

            if (model is VFXParameter || model is VFXSlot && (model as VFXSlot).owner is VFXParameter)
            {
                BuildParameterInfo();
            }


            if (cause == VFXModel.InvalidationCause.kStructureChanged)
            {
                UpdateSubAssets();
                if (model == this)
                {
                    VFXSubgraphContext.CallOnGraphChanged(this);
                }

                m_DependentDirty = true;
            }

            if (cause == VFXModel.InvalidationCause.kSettingChanged && model is VFXParameter)
            {
                VFXSubgraphContext.CallOnGraphChanged(this);
                m_DependentDirty = true;
            }

            if (cause != VFXModel.InvalidationCause.kExpressionInvalidated &&
                cause != VFXModel.InvalidationCause.kExpressionGraphChanged &&
                cause != VFXModel.InvalidationCause.kUIChangedTransient &&
                (model.hideFlags & HideFlags.DontSave) == 0)
            {
                EditorUtility.SetDirty(this);
            }

            if (cause == VFXModel.InvalidationCause.kExpressionGraphChanged || cause == VFXModel.InvalidationCause.kConnectionChanged)
            {
                m_ExpressionGraphDirty = true;
                m_DependentDirty       = true;
            }

            if (cause == VFXModel.InvalidationCause.kParamChanged)
            {
                m_ExpressionValuesDirty = true;
                m_DependentDirty        = true;
            }
        }
        public void InvalidateExpressionGraph(VFXModel model, VFXModel.InvalidationCause cause)
        {
            if (cause != VFXModel.InvalidationCause.kStructureChanged &&
                cause != VFXModel.InvalidationCause.kExpressionInvalidated &&
                cause != VFXModel.InvalidationCause.kParamChanged)
            {
                ExpressionGraphDirtyParamOnly = false;
                return;
            }

            ExpressionGraphDirty          = true;
            ExpressionGraphDirtyParamOnly = cause == VFXModel.InvalidationCause.kParamChanged;
        }
Ejemplo n.º 9
0
 private void OnModelInvalidated(VFXModel model, VFXModel.InvalidationCause cause)
 {
     s_logs.Add("OnInvalidateDelegate " + model + " " + cause);
 }