private IEnumerator ChangeActivePanelCoroutine(Panel panelNew) { yield return(new WaitForSeconds(0.0625f)); // Deactivate current panel yield return(StartCoroutine(panelCurrent.DeactivatePanel())); yield return(new WaitForSeconds(0.125f)); panelCurrent.gameObject.SetActive(false); // Activate new panel panelCurrent = panelNew; panelCurrent.gameObject.SetActive(true); panelCurrent.ActivatePanel(); }
private IEnumerator StartGamemodeCoroutine(int gamemodeIndex) { // Deactivate current panel yield return(StartCoroutine(panelCurrent.DeactivatePanel())); yield return(new WaitForSeconds(0.25f)); panelCurrent.gameObject.SetActive(false); // Activate game panel panelCurrent = panelGame; panelCurrent.gameObject.SetActive(true); yield return(new WaitForSeconds(0.0625f)); panelCurrent.ActivatePanel(); yield return(new WaitForSeconds(1f)); StartCoroutine(board.StartGame(gamemodeIndex)); }