Exemplo n.º 1
0
        /// <summary>
        /// On Play we turn our light on and start an over time coroutine if needed
        /// </summary>
        /// <param name="position"></param>
        /// <param name="attenuation"></param>
        protected override void CustomPlayFeedback(Vector3 position, float attenuation = 1.0f)
        {
            if (Active)
            {
                Turn(true);
                switch (Mode)
                {
                case Modes.Instant:
                    BoundLight.intensity      = InstantIntensity;
                    BoundLight.shadowStrength = InstantShadowStrength;
                    BoundLight.range          = InstantRange;
                    if (ModifyColor)
                    {
                        BoundLight.color = InstantColor;
                    }
                    break;

                case Modes.OverTime:
                    StartCoroutine(LightSequence());
                    break;

                case Modes.ShakerEvent:
                    MMLightShakeEvent.Trigger(Duration, RelativeValues, ModifyColor, ColorOverTime, IntensityCurve,
                                              RemapIntensityZero, RemapIntensityOne, RangeCurve, RemapRangeZero, RemapRangeOne,
                                              ShadowStrengthCurve, RemapShadowStrengthZero, RemapShadowStrengthOne, attenuation,
                                              Channel, ResetShakerValuesAfterShake, ResetTargetValuesAfterShake,
                                              UseRange, EventRange, EventOriginTransform.position);
                    break;
                }
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// On Play we turn our light on and start an over time coroutine if needed
        /// </summary>
        /// <param name="position"></param>
        /// <param name="feedbacksIntensity"></param>
        protected override void CustomPlayFeedback(Vector3 position, float feedbacksIntensity = 1.0f)
        {
            if (!Active || !FeedbackTypeAuthorized)
            {
                return;
            }

            float intensityMultiplier = Timing.ConstantIntensity ? 1f : feedbacksIntensity;

            Turn(true);
            switch (Mode)
            {
            case Modes.Instant:
                BoundLight.intensity      = InstantIntensity * intensityMultiplier;
                BoundLight.shadowStrength = InstantShadowStrength;
                BoundLight.range          = InstantRange;
                if (ModifyColor)
                {
                    BoundLight.color = InstantColor;
                }
                break;

            case Modes.OverTime:
                if (!AllowAdditivePlays && (_coroutine != null))
                {
                    return;
                }
                _coroutine = Owner.StartCoroutine(LightSequence(intensityMultiplier));

                break;

            case Modes.ShakerEvent:
                MMLightShakeEvent.Trigger(FeedbackDuration, RelativeValues, ModifyColor, ColorOverTime, IntensityCurve,
                                          RemapIntensityZero, RemapIntensityOne, RangeCurve, RemapRangeZero * intensityMultiplier, RemapRangeOne * intensityMultiplier,
                                          ShadowStrengthCurve, RemapShadowStrengthZero, RemapShadowStrengthOne, feedbacksIntensity,
                                          Channel, ResetShakerValuesAfterShake, ResetTargetValuesAfterShake,
                                          UseRange, EventRange, EventOriginTransform.position);
                break;
            }
        }