using UnityEngine; public class TimeManager : MonoBehaviour { public static readonly float[] GAME_SPEEDS = new float[3]{ 1, 1.5f, 2 }; public static float GAME_SPEED = 1; public void ChangeGameSpeed(int index) { if (index < 0 || index >= GAME_SPEEDS.Length) { GAME_SPEED = GAME_SPEEDS[0]; } else { GAME_SPEED = GAME_SPEEDS[index]; } } }