using UnityEngine; using System.Collections; public class SpeedUp : MonoBehaviour { private static SpeedUp Instance; void Start () { Instance = this; } public static void StartRace() { Time.timeScale = 1; Instance.StartCoroutine(Instance.Up()); } private IEnumerator Up() { while (transform) { yield return new WaitForSeconds(1f); Time.timeScale += 0.001f; } } }