public void Init(int[] buffIDs) { PartyBuffDisplay[] componentsInChildren = this.m_partyBuffRoot.GetComponentsInChildren <PartyBuffDisplay>(true); foreach (PartyBuffDisplay partyBuffDisplay in componentsInChildren) { Object.DestroyImmediate(partyBuffDisplay.gameObject); } foreach (int ability in buffIDs) { PartyBuffDisplay partyBuffDisplay2 = Object.Instantiate <PartyBuffDisplay>(this.m_partyBuffDisplayPrefab); partyBuffDisplay2.transform.SetParent(this.m_partyBuffRoot.transform, false); partyBuffDisplay2.SetAbility(ability); if (buffIDs.Length > 7) { partyBuffDisplay2.UseReducedHeight(); if (buffIDs.Length > 9) { VerticalLayoutGroup component = this.m_partyBuffRoot.GetComponent <VerticalLayoutGroup>(); if (component != null) { component.spacing = 3f; } } } } }
public void Init(int[] buffIDs) { PartyBuffDisplay[] componentsInChildren = this.m_partyBuffRoot.GetComponentsInChildren <PartyBuffDisplay>(true); PartyBuffDisplay[] array = componentsInChildren; for (int i = 0; i < array.Length; i++) { PartyBuffDisplay partyBuffDisplay = array[i]; Object.DestroyImmediate(partyBuffDisplay.get_gameObject()); } for (int j = 0; j < buffIDs.Length; j++) { int ability = buffIDs[j]; PartyBuffDisplay partyBuffDisplay2 = Object.Instantiate <PartyBuffDisplay>(this.m_partyBuffDisplayPrefab); partyBuffDisplay2.get_transform().SetParent(this.m_partyBuffRoot.get_transform(), false); partyBuffDisplay2.SetAbility(ability); } }