IEnumerator PrepareWndAsync(UIFlag uiID) { if (uiID != UIFlag.none) { UIWnd uiWnd = GetUIWnd(uiID); if (uiWnd == null) { if (!IsUICaching(uiID)) { m_lstCacheUIID.Add(uiID); IEnumerator itor = UIWndLoader.LoadUIWndAsync(uiID.ToString(), false); while (itor.MoveNext()) { yield return(null); } uiWnd = GetUIWnd(uiID); if (uiWnd != null) { uiWnd.gameObject.SetActive(false); } else { Debug.LogError("prepare ui failed: " + uiID.ToString()); } } } } }
IEnumerator SwitchWndAsync(UIFlag targetID, UIFlag preID, object exData) { if (targetID != UIFlag.none) { if (!IsUIShowing(targetID)) { UIWnd targetWnd = GetUIWnd(targetID); if (targetWnd != null) { targetWnd.gameObject.SetActive(true); m_lstShowUIID.Add(targetID); targetWnd.ReadyShow = false; WndData targetData = new WndData(exData); targetWnd.PreWndID = preID; targetWnd.OnShowWnd(targetData); while (!targetWnd.ReadyShow) { yield return(null); } } else { Debug.LogError("ui should be prepared before switched: " + targetID.ToString()); } } } }
IEnumerator DownLoadWndSync(UIFlag uiID) { if (uiID != UIFlag.none)//正确的ID; { IEnumerator itor = UIWndLoader.DownLoadUIWndAsync(uiID.ToString()); while (itor.MoveNext()) { yield return(null); } } }