예제 #1
0
파일: UIMgr.cs 프로젝트: happylays/tbb2
    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());
                    }
                }
            }
        }
    }
예제 #2
0
파일: UIMgr.cs 프로젝트: happylays/tbb2
    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());
                }
            }
        }
    }
예제 #3
0
파일: UIMgr.cs 프로젝트: happylays/tbb2
 IEnumerator DownLoadWndSync(UIFlag uiID)
 {
     if (uiID != UIFlag.none)//正确的ID;
     {
         IEnumerator itor = UIWndLoader.DownLoadUIWndAsync(uiID.ToString());
         while (itor.MoveNext())
         {
             yield return(null);
         }
     }
 }