Exemple #1
0
 public static LevelSO GetInstalledSong(string levelId = null)
 {
     try
     {
         if (levelId == null)
         {
             levelId = SteamAPI.GetSongId();
         }
         LevelSO level;
         if (levelId.Length > 32)
         {
             if (SongLoader.CustomLevels == null)
             {
                 return(null);
             }
             LevelSO[] levels = SongLoader.CustomLevels.Where(l => l.levelID.StartsWith(levelId.Substring(0, 32))).ToArray();
             level = levels.Length > 0 ? levels[0] : null;
         }
         else
         {
             if (SongLoader.CustomLevelCollectionSO.levels == null)
             {
                 return(null);
             }
             LevelSO[] levels = SongLoader.CustomLevelCollectionSO.levels.Where(l => l.levelID.StartsWith(levelId)).ToArray();
             level = levels.Length > 0 ? levels[0] : null;
         }
         return(level);
     }
     catch (Exception e) {
         Data.Logger.Error(e);
         return(null);
     }
 }