1234567891011121314151617181920212223 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using UnityEngine.UI;
- public class SetFPS60ButtonTest : MonoBehaviour
- {
- // Start is called before the first frame update
- void Start()
- {
- this.GetComponent<Button>().onClick.AddListener(OnButtonClick);
- }
- private void OnDestroy()
- {
- this.GetComponent<Button>().onClick.RemoveListener(OnButtonClick);
- }
- private void OnButtonClick()
- {
- Application.targetFrameRate = 60;
- }
- }
|