Beispiel #1
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;
            }
        }
Beispiel #2
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;
            }
        }