Ejemplo n.º 1
0
    public void PlayPew()
    {
#if DEBUG
        // still finding some nice sounds to work with
        if (!pewSounds.Any() || audioPlayer == null)
        {
            return;
        }
        audioPlayer.Stop();
        var randomIndex = _random.Next(0, pewSounds.Length - 1);
        audioPlayer.pitch = (_animator != null ? _animator.speed : 1f) + Convert.ToSingle(_random.NextDouble() * 0.4);
        audioPlayer.PlayOneShot(pewSounds[randomIndex]);
        EventConsumer.EmitEvent(EventConsumer.EventType.Nomi);
#endif
    }