private void PlayExplosionSound(object enemy) { GenericSoundsEnum sound = ((Enemy)enemy).explosionSound; if (sound != GenericSoundsEnum.NONE) { PlaySound(sound); } }
private void PlayBulletSound(object fountain) { GenericSoundsEnum sound = ((BulletFountain)fountain).volleySound; if (sound != GenericSoundsEnum.NONE) { PlaySound(sound); } }
private void PlayCollectibleSound(object collectibleObj) { GenericSoundsEnum sound = ((Collectible)collectibleObj).sound; if (sound != GenericSoundsEnum.NONE) { PlaySound(sound); } }
public void PlaySound(GenericSoundsEnum sound) { if (!sounds.ContainsKey(sound)) { Debug.LogError("Sound:" + sound.ToString() + " doesn't exists"); return; } sounds[sound].Play(); }