// Token: 0x060024ED RID: 9453 RVA: 0x000A0F38 File Offset: 0x0009F138 private void AllocateCategories(int desiredCount) { while (this.categoryControllers.Count > desiredCount) { int index = this.categoryControllers.Count - 1; UnityEngine.Object.Destroy(this.categoryControllers[index].gameObject); this.categoryControllers.RemoveAt(index); } while (this.categoryControllers.Count < desiredCount) { RuleCategoryController component = UnityEngine.Object.Instantiate <GameObject>(this.categoryPrefab, this.categoryContainer).GetComponent <RuleCategoryController>(); this.categoryControllers.Add(component); } }
internal static void RuleCategoryControllerSetData(On.RoR2.UI.RuleCategoryController.orig_SetData orig, RoR2.UI.RuleCategoryController self, RuleCategoryDef categoryDef, RuleChoiceMask availability, RuleBook ruleBook) { orig(self, categoryDef, availability, ruleBook); var stripContainer = self.transform.Find("StripContainer"); if (!stripContainer.gameObject.activeInHierarchy) { return; } stripContainer.Find("FrameContainer").gameObject.SetActive(false); for (var i = 0; i < stripContainer.childCount; i++) { var child = stripContainer.GetChild(i); if (child.gameObject.activeSelf) { SetupStripPrefab(child); } } }