private IEnumerator PlayOtherSoundCoroutine(OtherSoundType type) { audioOther.Stop(); switch (type) { case OtherSoundType.Talk: { audioOther.clip = talk; audioOther.loop = false; audioOther.volume = 1f; audioOther.Play(); break; } case OtherSoundType.Wave: { audioOther.clip = wave; audioOther.loop = true; audioOther.volume = 1f; audioOther.Play(); break; } case OtherSoundType.Point: { audioOther.clip = pointing; audioOther.loop = true; audioOther.volume = 1f; audioOther.Play(); break; } default: break; } yield return(null); }
private IEnumerator PlayOtherSoundCoroutine(OtherSoundType type) { audioOther.Stop(); switch (type) { case OtherSoundType.Talk: { audioOther.clip = talk; audioOther.loop = false; audioOther.volume = 1f; audioOther.Play(); break; } case OtherSoundType.Wave: { audioOther.clip = wave; audioOther.loop = true; audioOther.volume = 1f; audioOther.Play(); break; } case OtherSoundType.Point: { audioOther.clip = pointing; audioOther.loop = true; audioOther.volume = 1f; audioOther.Play(); break; } default:break; } yield return null; }
public void PlayOtherSound(OtherSoundType type) { StartCoroutine(PlayOtherSoundCoroutine(type)); }