Example #1
0
    private void PlayExplosionSound(object enemy)
    {
        GenericSoundsEnum sound = ((Enemy)enemy).explosionSound;

        if (sound != GenericSoundsEnum.NONE)
        {
            PlaySound(sound);
        }
    }
Example #2
0
    private void PlayBulletSound(object fountain)
    {
        GenericSoundsEnum sound = ((BulletFountain)fountain).volleySound;

        if (sound != GenericSoundsEnum.NONE)
        {
            PlaySound(sound);
        }
    }
Example #3
0
    private void PlayCollectibleSound(object collectibleObj)
    {
        GenericSoundsEnum sound = ((Collectible)collectibleObj).sound;

        if (sound != GenericSoundsEnum.NONE)
        {
            PlaySound(sound);
        }
    }
Example #4
0
    public void PlaySound(GenericSoundsEnum sound)
    {
        if (!sounds.ContainsKey(sound))
        {
            Debug.LogError("Sound:" + sound.ToString() + " doesn't exists");
            return;
        }

        sounds[sound].Play();
    }