コード例 #1
0
    void process_BackPopupUI(UI_PopupBase popupBase)
    {
        Type popupType = popupBase.GetType();

        if (popupType == typeof(UI_Popup_Selective))
        {
            popupBase.GetComponent <UI_Popup_Selective>().ResponseButton_No();
        }
        else if (popupType == typeof(UI_Popup_Notice))
        {
            popupBase.GetComponent <UI_Popup_Notice>().ResponseButton_Yes();
        }
        else if (popupType == typeof(UI_Popup_Attendace))
        {
            popupBase.GetComponent <UI_Popup_Attendace>().ResponseButton_close();
        }
        else if (popupType == typeof(UI_Popup_Reinforce))
        {
            popupBase.GetComponent <UI_Popup_Reinforce>().ResponseButton_Close();
        }
        else if (popupType == typeof(UI_Popup_RfProcess))
        {
            popupBase.GetComponent <UI_Popup_RfProcess>().ResponseButton_ReinforceEnd();
        }
        else if (popupType == typeof(UI_Popup_StartGame))
        {
            popupBase.GetComponent <UI_Popup_StartGame>().ResponseButton_Close();
        }
        else
        {
            ClearUI(popupBase);
        }
    }
コード例 #2
0
    bool ChkGetPopup <T>(out T p, UIPOPUP _popup)
    {
        bool isExist = false;

        p = default(T);

        for (int i = 0; i < UIPopupList.Count; i++)
        {
            if (UIPopupList[i].GetType() == typeof(UI_Popup_Toast))
            {
                ClearUI(UIPopupList[i]);
                UI_PopupBase _uiPopupBase = null;
                Scene        _scene       = SceneManager.GetActiveScene();
                if (_scene.name == DefineKey.Main)
                {
                    _uiPopupBase = InstantiateUI(_popup, parentToastPopup_Tr);
                }
                else
                {
                    _uiPopupBase = InstantiateUI(_popup, CanvasTr);
                }

                p       = _uiPopupBase.GetComponent <T>();
                isExist = true;
                break;
            }
            //else if (UIPopupList[i].GetType() == typeof(UI_Popup_ChatMessage))
            //{
            //    p = UIPopupList[i].GetComponent<T>();
            //    //UI_Popup_Toast t = p as UI_Popup_Toast;
            //    //if (t.toastType == ToastPopUpType.Notice)
            //    isExist = true;
            //    //else
            //    //	isExist = false;
            //    break;
            //}
        }

        return(isExist);
    }
コード例 #3
0
    }    // end of function

    public T CreatAndGetPopup <T>(UIPOPUP _popup)
    {
        T popUp = default(T);

        if (_popup == UIPOPUP.POPUPTOAST || _popup == UIPOPUP.POPUPCHATMESSAGE)
        {
            if (!ChkGetPopup(out popUp, _popup))
            {
                UI_PopupBase _uiPopupBase = null;
                Scene        _scene       = SceneManager.GetActiveScene();
                if (_scene.name == DefineKey.Main)                 // Tr을 분리하였기때문에  메인씬쪽은 따로 팝업을 생성처리한다
                {
                    _uiPopupBase = InstantiateUI(_popup, parentToastPopup_Tr);
                }
                else
                {
                    _uiPopupBase = InstantiateUI(_popup, CanvasTr);
                }
                popUp = _uiPopupBase.GetComponent <T>();
            }
        }
        else
        {
            UI_PopupBase _uiPopupBase = null;
            Scene        _scene       = SceneManager.GetActiveScene();
            if (_scene.name == DefineKey.Main)             // Tr을 분리하였기때문에  메인씬쪽은 따로 팝업을 생성처리한다
            {
                _uiPopupBase = InstantiateUI(_popup, parentPopup_Tr);
            }
            else
            {
                _uiPopupBase = InstantiateUI(_popup, CanvasTr);
            }
            popUp = _uiPopupBase.GetComponent <T>();
        }

        return(popUp);
    }