/// <summary> /// 改变歌曲 /// </summary> /// <param name="index">歌曲索引</param> internal static void ChangeSong(int index) { if (ModelManager.Instance.GetLogicDatas.GameState == GameState.Loading) { return; } SongControl.StopSong(); SongControl.ReleaseAudioRelatedResources(); string[] songName = ModelManager.Instance.GetLogicDatas.SongsName; if (index < 0 || index >= songName.Length) { return; } ModelManager.Instance.GetLogicDatas.CurrentSongIndex = index; SongControl.LoadNextSong(songName[index]); }
/// <summary> /// 播放下一首 /// </summary> internal static void PlayNextSong() { LogicDatas logicDatas = ModelManager.Instance.GetLogicDatas; if (logicDatas.GameState == GameState.StandBy) { SongControl.LoadNextSong(logicDatas.SongsName[0]); } else if (logicDatas.GameState == GameState.Playing || logicDatas.GameState == GameState.Pause) { logicDatas.CurrentSongIndex++; logicDatas.CurrentSongIndex %= logicDatas.SongsName.Length; logicDatas.Index = 0; SongControl.StopSong(); SongControl.ReleaseAudioRelatedResources(); SongControl.LoadNextSong(logicDatas.SongsName[logicDatas.CurrentSongIndex]); } }