driving_006_script
driving_006_script
//These scripts will countdown to the race and set controls active
// Countdown script
using UnityEngine.UI;
void Start () {
StartCoroutine (CountStart ());
}
IEnumerator CountStart () {
yield return new WaitForSeconds (0.5f);
CountDown.GetComponent<Text> ().text = "3";
GetReady.Play ();
CountDown.SetActive (true);
yield return new WaitForSeconds (1);
CountDown.SetActive (false);
CountDown.GetComponent<Text> ().text = "2";
GetReady.Play ();
CountDown.SetActive (true);
yield return new WaitForSeconds (1);
CountDown.SetActive (false);
CountDown.GetComponent<Text> ().text = "1";
GetReady.Play ();
CountDown.SetActive (true);
yield return new WaitForSeconds (1);
CountDown.SetActive (false);
GoAudio.Play ();
LapTimer.SetActive (true);
CarControls.SetActive (true);
function Start () {
CarControl.GetComponent("CarController").enabled = true;