SetFPS60ButtonTest.cs 516 B

1234567891011121314151617181920212223
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using UnityEngine.UI;
  5. public class SetFPS60ButtonTest : MonoBehaviour
  6. {
  7. // Start is called before the first frame update
  8. void Start()
  9. {
  10. this.GetComponent<Button>().onClick.AddListener(OnButtonClick);
  11. }
  12. private void OnDestroy()
  13. {
  14. this.GetComponent<Button>().onClick.RemoveListener(OnButtonClick);
  15. }
  16. private void OnButtonClick()
  17. {
  18. Application.targetFrameRate = 60;
  19. }
  20. }