예제 #1
0
    public void PlaySFX(SFXEvent p_event)
    {
        SFXSound sfx = m_sounds.Get(p_event);

        if (sfx == null)
        {
            Debug.Log($"{p_event.Value} wasn't found in registered sounds");
        }

        Play(sfx);
    }
예제 #2
0
    public void PlaySFX(string p_eventName)
    {
        SFXSound sfx = m_sounds.Get(p_eventName);

        if (sfx == null)
        {
            Debug.Log($"{p_eventName} wasn't found in registered sounds");
        }

        Play(sfx);
    }
예제 #3
0
    public void Play(SFXSound p_sfx)
    {
        var player = SimplePool.Spawn(m_oneShotSFX);

        var audioSource = player.GetComponent <AudioSource>();

        audioSource.clip   = p_sfx.GetClip();
        audioSource.volume = p_sfx.GetVolume();
        audioSource.pitch  = p_sfx.GetPitch();
        audioSource.outputAudioMixerGroup = p_sfx.MixerGroup;
        audioSource.Play();

        var autoDestroy = player.GetComponent <SFXAutoDestroy>();

        autoDestroy.Destroy();
    }
 public void Play(SFXSound p_sfx)
 {
     m_soundSystem.Play(p_sfx);
 }
예제 #5
0
        /// <summary>Plays SFX sound of given type</summary>
        public void PlaySFXSound(SFXSound sound)
        {
            SFXSoundContainer container = sfxContainers[sound];

            PlaySound(GetSource(), container.Clip, false, container.Volume * SFXVolumePercentage);
        }