/// <summary> /// Get level collection by level collection name. /// </summary> /// <param name="levelCollectionName"></param> /// <returns></returns> public IAnnotatedBeatmapLevelCollection GetLevelCollectionByName(String levelCollectionName) { IAnnotatedBeatmapLevelCollection levelCollection = null; // search level packs foreach (IBeatmapLevelPack o in BeatmapLevelsModel.allLoadedBeatmapLevelPackCollection.beatmapLevelPacks) { if (String.Equals(o.collectionName, levelCollectionName)) { levelCollection = o; break; } } // search playlists if (levelCollection == null) { IAnnotatedBeatmapLevelCollection[] _annotatedBeatmapLevelCollections = AnnotatedBeatmapLevelCollectionsViewController.GetPrivateField <IAnnotatedBeatmapLevelCollection[]>("_annotatedBeatmapLevelCollections"); foreach (IAnnotatedBeatmapLevelCollection c in _annotatedBeatmapLevelCollections) { if (String.Equals(c.collectionName, levelCollectionName)) { levelCollection = c; break; } } } return(levelCollection); }
/// <summary> /// Get level collection by level collection name. /// </summary> /// <param name="levelCollectionName"></param> /// <returns></returns> public IAnnotatedBeatmapLevelCollection GetLevelCollectionByName(String levelCollectionName) { IAnnotatedBeatmapLevelCollection levelCollection = null; // search level packs BeatmapLevelPackCollectionSO beatMapLevelPackCollection = Resources.FindObjectsOfTypeAll <BeatmapLevelPackCollectionSO>().Last(); IBeatmapLevelPack[] levelPacks = beatMapLevelPackCollection.GetPrivateField <IBeatmapLevelPack[]>("_allBeatmapLevelPacks"); foreach (IBeatmapLevelPack o in levelPacks) { if (String.Equals(o.collectionName, levelCollectionName)) { levelCollection = o; break; } } // search playlists if (levelCollection == null) { IAnnotatedBeatmapLevelCollection[] _annotatedBeatmapLevelCollections = AnnotatedBeatmapLevelCollectionsViewController.GetPrivateField <IAnnotatedBeatmapLevelCollection[]>("_annotatedBeatmapLevelCollections"); foreach (IAnnotatedBeatmapLevelCollection c in _annotatedBeatmapLevelCollections) { if (String.Equals(c.collectionName, levelCollectionName)) { levelCollection = c; break; } } } return(levelCollection); }