コード例 #1
0
ファイル: UIMgr.cs プロジェクト: happylays/tbb2
    void HideWndSync(UIFlag hideID)
    {
        if (hideID != UIFlag.none)
        {
            if (IsUIShowing(hideID))
            {
                m_lstShowUIID.Remove(hideID);

                UIWnd hideWnd = GetUIWnd(hideID);
                if (hideWnd != null)
                {
                    hideWnd.OnHideWnd();
                    hideWnd.gameObject.SetActive(false);
                }
            }
        }
    }
コード例 #2
0
ファイル: UIMgr.cs プロジェクト: happylays/tbb2
    IEnumerator DestoryAllWndAsync()
    {
        UICoroutine.uiCoroutine.gameObject.SetActive(false);            //停止所有UICoroutine
        UICoroutine.uiCoroutine.gameObject.SetActive(true);

        int showIDCount = m_lstShowUIID.Count;

        for (int i = 0; i < showIDCount; ++i)
        {
            UIFlag hideID  = m_lstShowUIID[i];
            UIWnd  hideWnd = GetUIWnd(hideID);
            if (hideWnd != null)
            {
                hideWnd.OnHideWnd();
                hideWnd.gameObject.SetActive(false);
            }
        }

        m_lstShowUIID.Clear();

        Dictionary <UIFlag, UIWnd> mapAllMap = new Dictionary <UIFlag, UIWnd>(m_mapAllUIWnd);

        m_mapAllUIWnd.Clear();
        m_lstCacheUIID.Clear();

        foreach (KeyValuePair <UIFlag, UIWnd> kvp in mapAllMap)
        {
            if (kvp.Value != null && kvp.Value.gameObject)
            {
                GameObject.Destroy(kvp.Value.gameObject);

                yield return(null); //wait for a frame
            }
            UIWndLoader.ReleaseUIWnd(kvp.Key.ToString());
        }
        mapAllMap.Clear();

        ////DynamicPrefabMgr.Instance.OnDestroyUI();
        UIWndLoader.ReleaseAllUIWnd();                  //check again
        UIAtlasLoader.ReleaseAllAtlas();
        //TipsBoxMgr.HideAllTipsBox();
        //MsgWaitMgr.StopWaiting();

        //LoadingMgr.HideViolently();
    }