// Out transition process IEnumerator OutTransition(MenuUI otherMenu = null, bool layered = false) { if (PauseWhenOpen) { EventManager.TriggerEvent("Unpause", gameObject); } // Out transition animation // wait yield return(new WaitForSecondsRealtime(OutTransitionTime)); if (otherMenu != null) { // enable other menu otherMenu.GetComponent <Canvas>().enabled = true; // Init that menu otherMenu.InitMenu(); } // disable self if (_canvas != null && !layered) { _canvas.enabled = false; } yield return(null); }