private void LoadUsedContentFromJSON(JsonData jsonData) { ContentManager.GameType type; ContentManager.GameType type2; for (type = ContentManager.GameType.SubTheTitle; type < ContentManager.GameType.Max; type = type2 + 1) { JsonData usedGameTypeContentData = jsonData[type.ToString()]; if (usedGameTypeContentData != null && usedGameTypeContentData.IsArray) { int j; int i; for (i = 0; i < usedGameTypeContentData.Count; i = j + 1) { if (usedGameTypeContentData[i].IsInt) { ContentManager.Content content = this._AvailableContent.Find((ContentManager.Content x) => x.GameType == type && x.ID == (int)usedGameTypeContentData[i]); if (content != null) { this._AvailableContent.Remove(content); this._UsedContent.Add(content); } } j = i; } } type2 = type; } }
private void ExcludeContent(ContentManager.GameType contentType, int contentID) { ContentManager.Content content = this._AvailableContent.Find((ContentManager.Content x) => x.GameType == contentType && x.ID == contentID); if (content != null) { this._AvailableContent.Remove(content); return; } content = this._UsedContent.Find((ContentManager.Content x) => x.GameType == contentType && x.ID == contentID); if (content != null) { this._UsedContent.Remove(content); } }
public ContentManager.Content FindRandomContent(ContentManager.GameType gameType) { if (Singleton <GameManager> .Instance.CurrentMode == GameManager.GameMode.Debug) { return(Singleton <GameManager> .Instance.ContentOverride); } Debug.Log("ContentManager.cs : 367"); List <ContentManager.Content> list = this._AvailableContent.FindAll((ContentManager.Content x) => x.GameType == gameType && (!Singleton <GameManager> .Instance.FamilyMode || x.FamilyMode)); Debug.Log("ContentManager.cs : 370"); if (list.Count == 0) { Debug.Log("ContentManager.cs : 375"); List <ContentManager.Content> collection = this._UsedContent.FindAll((ContentManager.Content x) => x.GameType == gameType && (!Singleton <GameManager> .Instance.FamilyMode || x.FamilyMode)); Debug.Log("ContentManager.cs : 378"); list.AddRange(collection); Debug.Log("ContentManager.cs : 381"); this._AvailableContent.AddRange(this._UsedContent.FindAll((ContentManager.Content x) => x.GameType == gameType)); Debug.Log("ContentManager.cs : 384"); this._UsedContent.RemoveAll((ContentManager.Content x) => x.GameType == gameType); } Debug.Log("ContentManager.cs : 388"); Debug.Log("ContentManager.cs : COUNT " + list.Count); int num = UnityEngine.Random.Range(0, list.Count); if (num >= list.Count) { num = list.Count - 1; } Debug.Log("ContentManager.cs : RANDIDX " + num); ContentManager.Content content = list[num]; this._AvailableContent.Remove(content); this._UsedContent.Add(content); base.StartCoroutine(this.SaveUsedContent()); return(content); }