public void Bing() { if (sv.getVolume() == true) { source.PlayOneShot(bing, 0.7f); } }
IEnumerator WaitOneSecond() { text.text = "3"; if (sv.getVolume()) { source.PlayOneShot(buzz, 0.7f); } yield return(new WaitForSeconds(1)); text.text = "2"; if (sv.getVolume()) { source.PlayOneShot(buzz, 0.7f); } yield return(new WaitForSeconds(1)); text.text = "1"; if (sv.getVolume()) { source.PlayOneShot(buzz, 0.7f); } yield return(new WaitForSeconds(1)); text.text = "Go!"; if (sv.getVolume()) { source.PlayOneShot(buzz, 0.7f); } yield return(new WaitForSeconds(1)); text.text = ""; car.GetComponent <FollowMouse>().enabled = true; coinSpawner[] coinspawners = coinSpawner.GetComponents <coinSpawner>(); Debug.Log("there"); foreach (coinSpawner cs in coinspawners) { cs.enabled = true; } //need the part above as the coinspawner has two identical components - one for yellow coins and one for red ones tyreSpawner.GetComponent <coinSpawner>().enabled = true; fuelSpawner.GetComponent <coinSpawner>().enabled = true; carSpawner.GetComponent <carspawner>().enabled = true; }