示例#1
0
 private void LobbyUI_OnBeatmapLoaded(object sender, BeatmapLoadedArgs e)
 {
     if (e.beatmap != null && e.clip != null && e.pathToBeatmap != null)
     {
         WipeCurrentlyLoaded();
         selectedBeatmap     = e.beatmap;
         selectedMusic       = e.clip;
         selectedBeatmapPath = e.pathToBeatmap;
         Debug.Log(selectedMusic == null);
         Debug.Log("beatmap loaded");
     }
 }
示例#2
0
文件: LobbyUI.cs 项目: soulwa/soulful
        private async void LoadBeatmap()
        {
            string beatmapDirectoryPath = RetrieveBeatmapDirectory();
            string beatmapPath          = Directory.GetFiles(beatmapDirectoryPath, "*.fnk")[0];

            Beatmap bm       = BeatmapSerializer.LoadBeatmap(beatmapPath);
            string  songPath = Path.Combine(SoulfulSettings.beatmapDataPath, bm.songInfo.pathToMusic);

            if (bm != null)
            {
                AudioClip clip = await GetAudioClipFromSong(songPath);

                BeatmapLoadedArgs e = new BeatmapLoadedArgs
                {
                    beatmap       = bm,
                    clip          = clip,
                    pathToBeatmap = beatmapDirectoryPath,
                };
                beatmapLoaded(this, e);
                UpdateSongName(bm.songInfo.name);
            }
        }