IEnumerator playFootstepSounds(float delay) { while (true) { if (rb.velocity != Vector2.zero) { footsteps.PlayClip(playerSounds); } yield return(new WaitForSeconds(delay)); } }
public void PlayClip(SoundClip clip) { clip.PlayClip(source); }
public void PlayClip(SoundClip clip) { clip.PlayClip(audioSources[GetFreeAudioSourceIdx()]); }