public void SwitchUIPanel(UI_Panel panel) { if (panel == null) { return; } StartCoroutine(ISwitchPanel(panel)); }
private IEnumerator ISwitchPanel(UI_Panel panel) { if (currentPanel) { currentPanel.Close(); yield return(new WaitWhile(() => currentPanel.IsAnimating)); } currentPanel = panel; yield return(new WaitForSeconds(panelSwitchDelay)); currentPanel.Open(); yield return(new WaitWhile(() => currentPanel.IsAnimating)); }