Пример #1
0
        protected override void GenerateErrors(VFXInvalidateErrorReporter manager)
        {
            VFXSetting capacitySetting = GetSetting("capacity");

            if ((uint)capacitySetting.value > 1000000)
            {
                manager.RegisterError("CapacityOver1M", VFXErrorType.PerfWarning, "Systems with large capacities can be slow to simulate");
            }
            var data = GetData() as VFXDataParticle;

            if (data != null && data.boundsSettingMode == BoundsSettingMode.Recorded &&
                CanBeCompiled())
            {
                if (VFXViewWindow.currentWindow?.graphView?.attachedComponent == null ||
                    !BoardPreferenceHelper.IsVisible(BoardPreferenceHelper.Board.componentBoard, false))
                {
                    manager.RegisterError("NeedsRecording", VFXErrorType.Warning,
                                          "In order to record the bounds, the current graph needs to be attached to a scene instance via the Target Game Object panel");
                }

                try
                {
                    var boundsSlot = inputSlots.First(s => s.name == "bounds");
                    if (boundsSlot.AllChildrenWithLink().Any())
                    {
                        manager.RegisterError("OverriddenRecording", VFXErrorType.Warning,
                                              "This system bounds will not be recorded because they are set from operators.");
                    }
                }
                catch { /* do nothing*/ }
            }
        }
Пример #2
0
        protected override void OnSettingModified(VFXSetting setting)
        {
            base.OnSettingModified(setting);

            if (setting.name == "capacity" && capacity == 0)
            {
                capacity = 1;
            }
            else if (setting.name == "stripCapacity" && stripCapacity == 0)
            {
                stripCapacity = 1;
            }
            else if (setting.name == "particlePerStripCount" && particlePerStripCount == 0)
            {
                particlePerStripCount = 1;
            }

            if (hasStrip)
            {
                if (setting.name == "dataType") // strip has just been set
                {
                    stripCapacity         = 1;
                    particlePerStripCount = capacity;
                }
                capacity = stripCapacity * particlePerStripCount;
            }
        }
        protected override void GenerateErrors(VFXInvalidateErrorReporter manager)
        {
            VFXSetting capacitySetting = GetSetting("capacity");

            if ((uint)capacitySetting.value > 1000000)
            {
                manager.RegisterError("CapacityOver1M", VFXErrorType.PerfWarning, "Systems with large capacities can be slow to simulate");
            }
        }
Пример #4
0
        public override VFXSetting GetSetting(string name)
        {
            VFXSetting setting = base.GetSetting(name);

            if (!setting.valid)
            {
                setting = subOutput.GetSetting(name);
            }
            return(setting);
        }
 protected override void OnSettingModified(VFXSetting setting)
 {
     base.OnSettingModified(setting);
     // Reset to default if render queue is invalid
     if (setting.name == "transparentRenderQueue")
     {
         if (!supportsQueueSelection || (isLit && transparentRenderQueue == TransparentRenderQueue.AfterPostProcessing))
         {
             transparentRenderQueue = TransparentRenderQueue.Default;
         }
     }
     else if (setting.name == "opaqueRenderQueue")
     {
         if (!supportsQueueSelection || (isLit && opaqueRenderQueue == OpaqueRenderQueue.AfterPostProcessing))
         {
             opaqueRenderQueue = OpaqueRenderQueue.Default;
         }
     }
 }
Пример #6
0
        public override void OnSettingModified(VFXSetting setting)
        {
            base.OnSettingModified(setting);

            if (setting.name == "capacity" && capacity == 0)
            {
                capacity = 1;
            }
            else if (setting.name == "stripCapacity" && stripCapacity == 0)
            {
                stripCapacity = 1;
            }
            else if (setting.name == "particlePerStripCount" && particlePerStripCount == 0)
            {
                particlePerStripCount = 1;
            }
            else if (setting.name == "boundsSettingMode")
            {
                //Refresh errors on Output contexts
                var allSystemOutputContexts = owners.Where(ctx => ctx is VFXAbstractParticleOutput);
                foreach (var ctx in allSystemOutputContexts)
                {
                    ctx.RefreshErrors(GetGraph());
                }
                if (boundsSettingMode == BoundsSettingMode.Automatic)
                {
                    needsComputeBounds = true;
                }
            }


            if (hasStrip)
            {
                if (setting.name == "dataType") // strip has just been set
                {
                    stripCapacity         = 1;
                    particlePerStripCount = capacity;
                }
                capacity = stripCapacity * particlePerStripCount;
            }
        }
Пример #7
0
        protected override void GenerateErrors(VFXInvalidateErrorReporter manager)
        {
            VFXSetting capacitySetting = GetSetting("capacity");

            if ((uint)capacitySetting.value > 1000000)
            {
                manager.RegisterError("CapacityOver1M", VFXErrorType.PerfWarning, "Systems with large capacities can be slow to simulate");
            }
            var data = GetData() as VFXDataParticle;

            if (data != null && CanBeCompiled())
            {
                if (data.boundsMode == BoundsSettingMode.Recorded)
                {
                    if (VFXViewWindow.GetWindow(GetGraph(), false, false)?.graphView?.attachedComponent == null ||
                        !BoardPreferenceHelper.IsVisible(BoardPreferenceHelper.Board.componentBoard, false))
                    {
                        manager.RegisterError("NeedsRecording", VFXErrorType.Warning,
                                              "In order to record the bounds, the current graph needs to be attached to a scene instance via the Target Game Object panel");
                    }
                    var boundsSlot = inputSlots.FirstOrDefault(s => s.name == "bounds");
                    if (boundsSlot != null && boundsSlot.HasLink(true))
                    {
                        manager.RegisterError("OverriddenRecording", VFXErrorType.Warning,
                                              "This system bounds will not be recorded because they are set from operators.");
                    }
                }

                if (data.boundsMode == BoundsSettingMode.Automatic)
                {
                    manager.RegisterError("CullingFlagAlwaysSimulate", VFXErrorType.Warning,
                                          "Setting the system Bounds Mode to Automatic will switch the culling flags of the Visual Effect asset" +
                                          " to 'Always recompute bounds and simulate'.");
                }
            }
        }
Пример #8
0
 // Override this method to update other settings based on a setting modification
 // Use OnIvalidate with KSettingChanged and not this method to handle other side effects
 protected virtual void OnSettingModified(VFXSetting setting)
 {
 }
Пример #9
0
 // Override this method to update other settings based on a setting modification
 // Use OnIvalidate with KSettingChanged and not this method to handle other side effects
 public virtual void OnSettingModified(VFXSetting setting)
 {
 }
Пример #10
0
 public bool CanTransferSetting(VFXSetting setting)
 {
     return(CanTransferSetting(setting.field.Name));
 }