public void UpdateCurrentPanel() { if (currentPanel != null) { currentPanel.InitializeData(); } PlayerGameManager.GetInstance.SetupResourceProductionUpdate(); UpdateCurrentPanelWarnings(); }
public void ShowResourcePanel(ResourcePanelType panelType, Action extraCallBack = null) { if (currentPanel != null) { currentPanel.gameObject.SetActive(true); currentPanel.isShowing = false; if (currentPanel.resourcePanelType != panelType) { StartCoroutine(currentPanel.myPanel.WaitAnimationForAction(currentPanel.myPanel.closeAnimationName, () => SwapDelay(panelType, extraCallBack))); } else { switch (panelType) { case ResourcePanelType.overhead: overheadPanel.gameObject.SetActive(true); sidePanel.gameObject.SetActive(false); overheadPanel.InitializeData(); currentPanel = overheadPanel; break; case ResourcePanelType.side: sidePanel.gameObject.SetActive(true); overheadPanel.gameObject.SetActive(false); sidePanel.InitializeData(); currentPanel = sidePanel; break; case ResourcePanelType.bottom: bottomPanel.gameObject.SetActive(true); sidePanel.gameObject.SetActive(false); overheadPanel.gameObject.SetActive(false); bottomPanel.InitializeData(); currentPanel = bottomPanel; break; default: break; } currentPanel.isShowing = true; StartCoroutine(currentPanel.myPanel.WaitAnimationForAction(currentPanel.myPanel.openAnimationName, extraCallBack)); } } else { switch (panelType) { case ResourcePanelType.overhead: overheadPanel.gameObject.SetActive(true); overheadPanel.InitializeData(); currentPanel = overheadPanel; currentPanel.weekController.UpdateWeekCountText(); break; case ResourcePanelType.side: sidePanel.gameObject.SetActive(true); sidePanel.InitializeData(); currentPanel = sidePanel; break; case ResourcePanelType.bottom: bottomPanel.gameObject.SetActive(true); bottomPanel.InitializeData(); currentPanel = bottomPanel; break; default: break; } currentPanel.isShowing = true; StartCoroutine(currentPanel.myPanel.WaitAnimationForAction(currentPanel.myPanel.openAnimationName, extraCallBack)); } UpdateCurrentPanel(); }