/// <summary>
 /// On stop we stop our transition
 /// </summary>
 /// <param name="position"></param>
 /// <param name="feedbacksIntensity"></param>
 protected override void CustomStopFeedback(Vector3 position, float feedbacksIntensity = 1)
 {
     base.CustomStopFeedback(position, feedbacksIntensity);
     if (Active)
     {
         MMAudioFilterDistortionShakeEvent.Trigger(ShakeDistortion, FeedbackDuration, 0f, 0f, stop: true);
     }
 }
Example #2
0
 /// <summary>
 /// Triggers the corresponding coroutine
 /// </summary>
 /// <param name="position"></param>
 /// <param name="attenuation"></param>
 protected override void CustomPlayFeedback(Vector3 position, float attenuation = 1.0f)
 {
     if (Active)
     {
         MMAudioFilterDistortionShakeEvent.Trigger(ShakeDistortion, Duration, RemapDistortionZero, RemapDistortionOne, RelativeDistortion,
                                                   attenuation, Channel, ResetShakerValuesAfterShake, ResetTargetValuesAfterShake);
     }
 }
        /// <summary>
        /// On stop we stop our transition
        /// </summary>
        /// <param name="position"></param>
        /// <param name="feedbacksIntensity"></param>
        protected override void CustomStopFeedback(Vector3 position, float feedbacksIntensity = 1)
        {
            base.CustomStopFeedback(position, feedbacksIntensity);

            if (!Active || !FeedbackTypeAuthorized)
            {
                return;
            }
            MMAudioFilterDistortionShakeEvent.Trigger(ShakeDistortion, FeedbackDuration, 0f, 0f, stop: true);
        }
Example #4
0
        /// <summary>
        /// Triggers the corresponding coroutine
        /// </summary>
        /// <param name="position"></param>
        /// <param name="feedbacksIntensity"></param>
        protected override void CustomPlayFeedback(Vector3 position, float feedbacksIntensity = 1.0f)
        {
            if (Active)
            {
                float intensityMultiplier = Timing.ConstantIntensity ? 1f : feedbacksIntensity;
                float remapZero           = 0f;
                float remapOne            = 0f;

                if (!Timing.ConstantIntensity)
                {
                    remapZero = RemapDistortionZero * intensityMultiplier;
                    remapOne  = RemapDistortionOne * intensityMultiplier;
                }

                MMAudioFilterDistortionShakeEvent.Trigger(ShakeDistortion, FeedbackDuration, remapZero, remapOne, RelativeDistortion,
                                                          intensityMultiplier, Channel, ResetShakerValuesAfterShake, ResetTargetValuesAfterShake, NormalPlayDirection);
            }
        }
Example #5
0
 /// <summary>
 /// Stops listening for events
 /// </summary>
 public override void StopListening()
 {
     base.StopListening();
     MMAudioFilterDistortionShakeEvent.Unregister(OnMMAudioFilterDistortionShakeEvent);
 }