Пример #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 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'.");
                }
            }
        }