private void OnEnable() { LegionfallBuildingPanel[] componentsInChildren = this.m_content.gameObject.GetComponentsInChildren <LegionfallBuildingPanel>(true); for (int i = 0; i < (int)componentsInChildren.Length; i++) { UnityEngine.Object.Destroy(componentsInChildren[i].gameObject); } LegionfallBuildingPanel legionfallBuildingPanel = UnityEngine.Object.Instantiate <LegionfallBuildingPanel>(this.m_legionfallBuildingPanelPrefab); legionfallBuildingPanel.InitPanel(1, 46277); legionfallBuildingPanel.transform.SetParent(this.m_content, false); LegionfallBuildingPanel legionfallBuildingPanel1 = UnityEngine.Object.Instantiate <LegionfallBuildingPanel>(this.m_legionfallBuildingPanelPrefab); legionfallBuildingPanel1.InitPanel(3, 46735); legionfallBuildingPanel1.transform.SetParent(this.m_content, false); LegionfallBuildingPanel legionfallBuildingPanel2 = UnityEngine.Object.Instantiate <LegionfallBuildingPanel>(this.m_legionfallBuildingPanelPrefab); legionfallBuildingPanel2.InitPanel(4, 46736); legionfallBuildingPanel2.transform.SetParent(this.m_content, false); }
private void OnEnable() { LegionfallBuildingPanel[] componentsInChildren = this.m_content.gameObject.GetComponentsInChildren <LegionfallBuildingPanel>(true); foreach (LegionfallBuildingPanel legionfallBuildingPanel in componentsInChildren) { Object.Destroy(legionfallBuildingPanel.gameObject); } LegionfallBuildingPanel legionfallBuildingPanel2 = Object.Instantiate <LegionfallBuildingPanel>(this.m_legionfallBuildingPanelPrefab); legionfallBuildingPanel2.InitPanel(1, 46277); legionfallBuildingPanel2.transform.SetParent(this.m_content, false); LegionfallBuildingPanel legionfallBuildingPanel3 = Object.Instantiate <LegionfallBuildingPanel>(this.m_legionfallBuildingPanelPrefab); legionfallBuildingPanel3.InitPanel(3, 46735); legionfallBuildingPanel3.transform.SetParent(this.m_content, false); LegionfallBuildingPanel legionfallBuildingPanel4 = Object.Instantiate <LegionfallBuildingPanel>(this.m_legionfallBuildingPanelPrefab); legionfallBuildingPanel4.InitPanel(4, 46736); legionfallBuildingPanel4.transform.SetParent(this.m_content, false); }