Esempio n. 1
0
        private void play_se(
            string bank,
            string cue_name,
            Maybe <float> pitch,
            Maybe <int> channel,
            bool duckBgm)
        {
            // If too many sounds and not important enough
            if (too_many_active_sounds && false)
            {
                return;
            }
            SoundEffectGetter sound = get_sound(bank, cue_name);

            if (sound.Sound == null)
            {
                sound.Dispose();
                return;
            }
            SoundEffectInstance instance = sound_instance(sound, cue_name, pitch);

            add_new_playing_sound(instance, channel, duckBgm);

            sound.Dispose();
        }
Esempio n. 2
0
        private void play_me(string bank, string cue_name)
        {
            SoundEffectGetter sound = get_sound(bank, cue_name);

            if (sound.Sound == null)
            {
                sound.Dispose();
                return;
            }

            sound.Instance.Pitch = 0f;
            if (PITCHES.ContainsKey(cue_name))
            {
                sound.Instance.Pitch = PITCHES[cue_name];
            }
            BgmManager.PlayMusicEffect(sound.Instance);

            sound.Dispose();
            return;
        }
Esempio n. 3
0
        private void play_system_se(string bank, string cue_name, bool priority, Maybe <float> pitch)
        {
            SoundEffectGetter sound = get_sound(bank, cue_name, true);

            if (sound.Sound == null)
            {
                sound.Dispose();
                return;
            }

            cancel_system_sound();
            System_Sound = sound_instance(sound, cue_name, pitch);
            System_Sound.Play();
            System_SFX_Priority = priority;
            if (System_Sound.State == SoundState.Initial)
            {
                System_Sound.Dispose();
                System_Sound        = null;
                System_SFX_Priority = false;
            }
            sound.Dispose();
            return;
        }