示例#1
0
 /// <summary>
 /// On Play, sends a shake camera event
 /// </summary>
 /// <param name="position"></param>
 /// <param name="attenuation"></param>
 protected override void CustomPlayFeedback(Vector3 position, float attenuation = 1.0f)
 {
     if (Active)
     {
         MMCameraShakeEvent.Trigger(CameraShakeProperties.Duration, CameraShakeProperties.Amplitude * attenuation, CameraShakeProperties.Frequency, RepeatUntilStopped, Channel);
     }
 }
 /// <summary>
 /// On Play, sends a shake camera event
 /// </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;
         MMCameraShakeEvent.Trigger(FeedbackDuration, CameraShakeProperties.Amplitude * intensityMultiplier, CameraShakeProperties.Frequency,
                                    CameraShakeProperties.AmplitudeX * intensityMultiplier, CameraShakeProperties.AmplitudeY * intensityMultiplier, CameraShakeProperties.AmplitudeZ * intensityMultiplier,
                                    RepeatUntilStopped, Channel, Timing.TimescaleMode == TimescaleModes.Unscaled);
     }
 }
 /// <summary>
 /// On disable, stops listening to events
 /// </summary>
 protected virtual void OnDisable()
 {
     MMCameraShakeEvent.Unregister(OnCameraShakeEvent);
 }
 /// <summary>
 /// On enable, starts listening for events
 /// </summary>
 protected virtual void OnEnable()
 {
     MMCameraShakeEvent.Register(OnCameraShakeEvent);
 }