示例#1
0
    /// <summary>
    /// 팝업창에 있는 UI를 지움
    /// 팝업창을 지우는데 따로 선택 해주지 않는다면 팝업창 맨앞에 떠있는걸 지움
    /// </summary>
    /// <param name="name"></param>
    public void DestroyPopupUI(UI_NAME name = UI_NAME.NONE)
    {
        var delPopup = _listPopup.Find((c) => c.Name() == name);

        if (delPopup == null)
        {
            if (_listPopup.Count < 1)
            {
                return;
            }
            delPopup = _listPopup.FindLast((c) => c != null);
        }

        _listPopup.Remove(delPopup);

        if (_listPopup.Count > 0)
        {
            var popup = _listPopup.FindLast((c) => c is UIBase);
            delPopup.CurrentScene.CurrentUI = popup;
            popup.Start();
        }
        else if (_mapPageStack[_currentPage].Count > 0)
        {
            delPopup.CurrentScene.CurrentUI = _mapPageStack[_currentPage][_mapPageStack[_currentPage].Count - 1];
            _mapPageStack[_currentPage][_mapPageStack[_currentPage].Count - 1].Start();
        }
        else if (_currentPage != null)
        {
            delPopup.CurrentScene.CurrentUI = _currentPage;
            _currentPage.Start();
        }


        delPopup = null;
    }
示例#2
0
 public T GetPopupUI <T>(UI_NAME name) where T : UIBase
 {
     return(_listPopup.Find((c) => c.Name() == name) as T);
 }
示例#3
0
 public T GetStackUI <T>(UI_NAME name) where T : UIBase
 {
     return(_mapPageStack[_currentPage].Find((c) => c.Name() == name) as T);
 }