public void playsound() { if (soundAvaliable == true) //if sound isnt already playing { soundAvaliable = false; //not allowed play more sound ShopSounds.PlaySound("carInstall"); //play sound coroutine = waittoplay(0.5f); // wait to set soundAvaliable true StartCoroutine(coroutine); } }
public void playsound() { if (soundAvaliable == true) //if sound isnt already playing { soundAvaliable = false; //stop more soounds ShopSounds.PlaySound("paintspray"); // play the sound coroutine = waittoplay(1f); // wait one second StartCoroutine(coroutine); } }