public static void RemoveSound(string Id) { if (!HasSound(Id)) { return; } CSoundManager Manager = GetInstance(); SSound Sound = Manager.SoundMap[Id]; if (!Sound.IsConstant) { Manager.SoundMap.Remove(Id); } }
public static void PlaySound(string Id) { if (!HasSound(Id)) { return; } CSoundManager Instance = GetInstance(); SSound Sound = Instance.SoundMap[Id]; if (Sound.Type == ESoundType.Effect) { Instance.SoundPlayer.PlayOneShot(Sound.Clip, Instance.EffectVolume); } else if (Sound.Type == ESoundType.Background) { Instance.SoundPlayer.Stop(); Instance.SoundPlayer.clip = Sound.Clip; Instance.SoundPlayer.Play(); } }
private static bool HasSound(SSound Sound) { return(GetInstance().SoundMap.Values.Contains(Sound)); }