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"); } }
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); } }