DebugForLerp.cs 753 B

123456789101112131415161718192021222324
  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) {
  11. this.transform.GetComponentInChildren<Text>().text =
  12. AimHandler.ins.lerpForRotation ? "关闭镜头旋转插值" : "开启镜头旋转插值";
  13. }
  14. }
  15. public void Click()
  16. {
  17. if (!AimHandler.ins) return;
  18. AimHandler.ins.lerpForRotation = !AimHandler.ins.lerpForRotation;
  19. this.transform.GetComponentInChildren<Text>().text =
  20. AimHandler.ins.lerpForRotation ? "关闭镜头旋转插值" : "开启镜头旋转插值";
  21. }
  22. }