Simple Unity Debugging Timescale Helper
using UnityEngine; | |
public class DebugTimeScaler : MonoBehaviour | |
{ | |
#if UNITY_EDITOR | |
void Update() | |
{ | |
if (Input.GetKeyDown(KeyCode.LeftBracket)) | |
{ | |
Time.timeScale /= 2f; | |
} | |
if (Input.GetKeyDown(KeyCode.RightBracket)) | |
{ | |
Time.timeScale *= 2f; | |
} | |
if (Input.GetKeyDown(KeyCode.Backspace)) | |
{ | |
Time.timeScale = 0f; | |
} | |
if (Input.GetKeyDown(KeyCode.Return)) | |
{ | |
Time.timeScale = 1f; | |
} | |
} | |
#endif | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment