| 1234567891011121314151617181920212223242526272829303132333435363738 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using UnityEngine.UI;
- public class StatesBackDebug : MonoBehaviour
- {
- InputField inputField;
- [System.NonSerialized] public int val;
- public static StatesBackDebug ins;
- void Start()
- {
- ins = this;
- inputField = GetComponentInChildren<InputField>();
- //init data
- val = PlayerPrefs.GetInt("StatesBack-Count", 0);
- RenderByVal();
- }
- void OnDestroy()
- {
- if (ins == this) ins = null;
- }
- public void OnEndEdit() {
- val = int.Parse(inputField.text);
- if (val < 0) val = 0;
- if (val > 499) val = 499;
- PlayerPrefs.SetInt("StatesBack-Count", val);
- RenderByVal();
- }
- void RenderByVal() {
- inputField.text = "";
- inputField.placeholder.GetComponent<Text>().text = "回退帧数:" + val;
- }
- }
|