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(); }
private SoundEffectInstance sound_instance(SoundEffectGetter sound, string cue_name, Maybe <float> pitch) { SoundEffectInstance instance = sound.Instance; instance.Volume = Sound_Fade_Volume * Sound_Volume; if (pitch.IsSomething) { instance.Pitch = pitch; } else if (PITCHES.ContainsKey(cue_name)) { instance.Pitch = PITCHES[cue_name]; } return(instance); }
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; }
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; }