CameraEffectMotionBlurProxy.cs 786 B

123456789101112131415161718192021222324252627282930313233
  1. using System;
  2. using UnityEngine;
  3. public class CameraEffectMotionBlurProxy : ControllerProxyBase<CameraController>
  4. {
  5. protected override void ThisStart()
  6. {
  7. this._autoEnable = false;
  8. }
  9. protected override void OnThisEnable()
  10. {
  11. base.OnThisEnable();
  12. if (object.ReferenceEquals(ControllerProxyBase<CameraController>.effectLock, this) && base.effect != null)
  13. {
  14. base.effect.OpenMotionBlur(this.frame / 60f, this.scale, base.transform.position);
  15. }
  16. }
  17. protected override void OnThisDisable()
  18. {
  19. if (object.ReferenceEquals(ControllerProxyBase<CameraController>.effectLock, this) && base.effect != null)
  20. {
  21. base.effect.CloseMotionBlur();
  22. }
  23. }
  24. [SerializeField]
  25. private float scale = 1f;
  26. [SerializeField]
  27. private uint frame = 8u;
  28. }