/// <summary> /// Play Sound Effect /// </summary> /// <param name="name">SE name.</param> public static void PlaySound(string name) { SoundEffect se = null; _ses.TryGetValue(name, out se); if (se == null) { se = GameContent.LoadContent <SoundEffect>("sound/" + name + ".wav"); _ses.Add(name, se); } se.Play(); }
/// <summary> /// Changes background music. /// </summary> /// <param name="title">BGM title.</param> public static void PlayBGM(string title) { if (title != _currentBGM) { Song song = null; _bgms.TryGetValue(title, out song); if (song == null) { song = GameContent.LoadContent <Song>("bgm/" + title + ".wav"); _bgms.Add(title, song); } _currentBGM = title; MediaPlayer.Play(song); } }