Пример #1
0
 public static void LoadSong(string songPath)
 {
     foreach (string file in Directory.EnumerateFiles(songPath))
     {
         if (file.EndsWith(".pmb"))
         {
             Beatmap beatmap = DeserializeBeatmap(file);
             if (beatmap == null)
             {
                 Debug.Log("Failed to load map " + file);
                 continue;
             }
             beatmap.Fix();
             BeatmapStoreInfo beatmapStoreInfo = new BeatmapStoreInfo()
             {
                 MapPath           = file,
                 SongPath          = beatmap.SongPath,
                 SongName          = beatmap.SongName,
                 RomanizedSongName = beatmap.RomanizedSongName,
                 DifficultyName    = beatmap.DifficultyName,
                 BackgroundPath    = beatmap.BackgroundPath,
                 uuid = beatmap.GetUUID()
             };
             if (Beatmaps == null)
             {
                 Beatmaps = new List <BeatmapStoreInfo>();
             }
             Beatmaps.Add(beatmapStoreInfo);
         }
     }
 }
Пример #2
0
    public void SetBeatmapInfo(BeatmapStoreInfo info)
    {
        if (SongNameText == null)
        {
            SongNameText = transform.Find("SongName").GetComponent <TextMeshProUGUI>();
        }
        SongNameText.text = $"{info.RomanizedSongName}\n[{info.DifficultyName}]";

        this.info = info;
    }
Пример #3
0
 public SongSelectItem(BeatmapStoreInfo beatmapStoreInfo)
 {
     this.beatmapStoreInfo = beatmapStoreInfo;
 }
Пример #4
0
 public void Add(BeatmapStoreInfo beatmap)
 {
     m_beatmaps.Add(beatmap);
 }