public static void SetupPLButton() { if (PlButton == null) { PlButton = (parentGuiView.AddUIComponent(typeof(PoliticsButton)) as PoliticsButton); } PlButton.Show(); }
public static void RemoveGui() { isGuiRunning = false; if (parentGuiView != null) { parentGuiView = null; UnityEngine.Object.Destroy(ecnomicUI); UnityEngine.Object.Destroy(realCityUI); UnityEngine.Object.Destroy(politicsUI); UnityEngine.Object.Destroy(EcButton); UnityEngine.Object.Destroy(RcButton); UnityEngine.Object.Destroy(PlButton); ecnomicUI = null; realCityUI = null; politicsUI = null; EcButton = null; RcButton = null; PlButton = null; } if (BButton != null) { UnityEngine.Object.Destroy(BButton); BButton = null; } if (PBButton != null) { UnityEngine.Object.Destroy(PBButton); PBButton = null; } if (buildingWindowGameObject != null) { UnityEngine.Object.Destroy(buildingWindowGameObject); } //remove HumanUI if (humanUI != null) { if (humanUI.parent != null) { humanUI.parent.eventVisibilityChanged -= HumanInfo_eventVisibilityChanged; } } if (HumanWindowGameObject != null) { UnityEngine.Object.Destroy(HumanWindowGameObject); } //remove TouristUI if (touristUI != null) { if (touristUI.parent != null) { touristUI.parent.eventVisibilityChanged -= TouristInfo_eventVisibilityChanged; } } if (TouristWindowGameObject != null) { UnityEngine.Object.Destroy(TouristWindowGameObject); } if (!isTransportLinesManagerRunning) { if (PBLUI != null) { if (PBLUI.parent != null) { PBLUI.parent.eventVisibilityChanged -= PBLInfo_eventVisibilityChanged; } } if (PBLWindowGameObject != null) { UnityEngine.Object.Destroy(PBLWindowGameObject); } PBLUI._initialized = false; } }