예제 #1
0
    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);
        }
    }
예제 #2
0
    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();
        }
    }
예제 #3
0
 private static bool HasSound(SSound Sound)
 {
     return(GetInstance().SoundMap.Values.Contains(Sound));
 }