public void PlaySound(AudioEnums.SoundId soundId) { List <AudioClip> audioFound; if (!_SoundDictionary.TryGetValue((int)soundId, out audioFound)) { return; } if (audioFound.Count > 0) { _SoundAudioSource.PlayOneShot(audioFound[Random.Range(0, audioFound.Count)]); } }
public static void PlayAudioSound(this MonoBehaviour mono, AudioEnums.SoundId soundId) { // =============================== PLAY THE SOUND ================================ // if (ReferenceEquals(SoundManager.InstanceAwake(), null)) { LogGame.Log("[Sound Manager] Sound Manager is null ... "); return; } SoundManager.Instance.PlaySound(soundId); LogGame.Log("[Sound Manager] Play the sound of game ... "); }