1234567891011121314151617181920212223242526272829 |
- 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;
- }
- }
- }
|