internal void UnregisterSFX(MinigameSFX _minigameSFX) { if (m_soundEffects.ContainsKey(_minigameSFX.Name)) { List <MinigameSFX> list = m_soundEffects[_minigameSFX.Name]; list.Remove(_minigameSFX); } }
internal void RegisterSFX(MinigameSFX _minigameSFX) { if (!m_soundEffects.ContainsKey(_minigameSFX.Name)) { _minigameSFX.SetVolume(SFxVolume); m_soundEffects.Add(_minigameSFX.Name, new List <MinigameSFX>()); } m_soundEffects[_minigameSFX.Name].Add(_minigameSFX); }
public MinigameSFX PlaySFX(string _name) { if (!AreSFXEnabled) { return(null); } MinigameSFX result = null; if (m_soundEffects.ContainsKey(_name)) { List <MinigameSFX> list = m_soundEffects[_name]; foreach (MinigameSFX item in list) { item.SetVolume(SFxVolume); if (!item.IsPlaying) { item.Play(); result = item; break; } } } return(result); }