Exemplo n.º 1
0
    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());
                }
            }
        }
    }
Exemplo n.º 2
0
 public virtual void OnShowWnd(WndData wndData)
 {
     m_bReadyShow = true;
 }