DebugForLerp.cs 746 B

1234567891011121314151617181920212223
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using UnityEngine.UI;
  5. public class DebugForLerp : MonoBehaviour
  6. {
  7. // Start is called before the first frame update
  8. void OnEnable()
  9. {
  10. if (!AimHandler.ins) return;
  11. this.transform.GetComponentInChildren<Text>().text =
  12. AimHandler.ins.lerpForRotation ? "关闭镜头旋转插值" : "开启镜头旋转插值";
  13. }
  14. public void Click()
  15. {
  16. if (!AimHandler.ins) return;
  17. AimHandler.ins.lerpForRotation = !AimHandler.ins.lerpForRotation;
  18. this.transform.GetComponentInChildren<Text>().text =
  19. AimHandler.ins.lerpForRotation ? "关闭镜头旋转插值" : "开启镜头旋转插值";
  20. }
  21. }