/// <summary>
        /// On play we trigger a OneTime or ToDestination play on our shader controller
        /// </summary>
        /// <param name="position"></param>
        /// <param name="feedbacksIntensity"></param>
        protected override void CustomPlayFeedback(Vector3 position, float feedbacksIntensity = 1.0f)
        {
            if (Active && (TargetShaderController != null))
            {
                float intensityMultiplier = Timing.ConstantIntensity ? 1f : feedbacksIntensity;

                TargetShaderController.RevertToInitialValueAfterEnd = RevertToInitialValueAfterEnd;
                if (Mode == Modes.OneTime)
                {
                    TargetShaderController.OneTimeDuration  = FeedbackDuration;
                    TargetShaderController.OneTimeAmplitude = OneTimeAmplitude;
                    TargetShaderController.OneTimeCurve     = OneTimeCurve;
                    if (NormalPlayDirection)
                    {
                        TargetShaderController.OneTimeRemapMin = OneTimeRemapMin * intensityMultiplier;
                        TargetShaderController.OneTimeRemapMax = OneTimeRemapMax * intensityMultiplier;
                    }
                    else
                    {
                        TargetShaderController.OneTimeRemapMin = OneTimeRemapMax * intensityMultiplier;
                        TargetShaderController.OneTimeRemapMax = OneTimeRemapMin * intensityMultiplier;
                    }
                    TargetShaderController.OneTime();
                }
                if (Mode == Modes.ToDestination)
                {
                    TargetShaderController.ToColor               = ToDestinationColor;
                    TargetShaderController.ToDestinationCurve    = ToDestinationCurve;
                    TargetShaderController.ToDestinationDuration = FeedbackDuration;
                    TargetShaderController.ToDestinationValue    = ToDestinationValue;
                    TargetShaderController.ToDestination();
                }
            }
        }
Exemplo n.º 2
0
 protected virtual void PerformPlay(ShaderController shaderController, float intensityMultiplier)
 {
     shaderController.RevertToInitialValueAfterEnd = RevertToInitialValueAfterEnd;
     if (Mode == Modes.OneTime)
     {
         shaderController.OneTimeDuration  = FeedbackDuration;
         shaderController.OneTimeAmplitude = OneTimeAmplitude;
         shaderController.OneTimeCurve     = OneTimeCurve;
         if (NormalPlayDirection)
         {
             shaderController.OneTimeRemapMin = OneTimeRemapMin * intensityMultiplier;
             shaderController.OneTimeRemapMax = OneTimeRemapMax * intensityMultiplier;
         }
         else
         {
             shaderController.OneTimeRemapMin = OneTimeRemapMax * intensityMultiplier;
             shaderController.OneTimeRemapMax = OneTimeRemapMin * intensityMultiplier;
         }
         shaderController.OneTime();
     }
     if (Mode == Modes.ToDestination)
     {
         shaderController.ToColor               = ToDestinationColor;
         shaderController.ToDestinationCurve    = ToDestinationCurve;
         shaderController.ToDestinationDuration = FeedbackDuration;
         shaderController.ToDestinationValue    = ToDestinationValue;
         shaderController.ToDestination();
     }
 }
 /// <summary>
 /// On play we make our renderer flicker
 /// </summary>
 /// <param name="position"></param>
 /// <param name="attenuation"></param>
 protected override void CustomPlayFeedback(Vector3 position, float attenuation = 1.0f)
 {
     if (Active && (TargetShaderController != null))
     {
         TargetShaderController.RevertToInitialValueAfterEnd = RevertToInitialValueAfterEnd;
         if (Mode == Modes.OneTime)
         {
             TargetShaderController.OneTimeDuration  = OneTimeDuration;
             TargetShaderController.OneTimeAmplitude = OneTimeAmplitude;
             TargetShaderController.OneTimeCurve     = OneTimeCurve;
             TargetShaderController.OneTimeRemapMin  = OneTimeRemapMin;
             TargetShaderController.OneTimeRemapMax  = OneTimeRemapMax;
             TargetShaderController.OneTime();
         }
         if (Mode == Modes.ToDestination)
         {
             TargetShaderController.ToColor               = ToDestinationColor;
             TargetShaderController.ToDestinationCurve    = ToDestinationCurve;
             TargetShaderController.ToDestinationDuration = ToDestinationDuration;
             TargetShaderController.ToDestinationValue    = ToDestinationValue;
             TargetShaderController.ToDestination();
         }
     }
 }