void FreeClip() { if (playing == this) { playing = null; } }
void PlayAudio() { if (playing != null) { Invoke("PlayAudio", 10); } else { playing = this; if (allowed) { audioSrc.Play(); } Invoke("FreeClip", audioSrc.clip.length); Invoke("PlayAudio", getWaitTime()); } }