//: UI uinit 생성
    public UI_Base CreatUI(UIITEM _uiItem, Transform _parentTr)
    {
        UI_Base _uibase = null;

        switch (_uiItem)
        {
        case UIITEM.ITEM_COMBATINFO:
        case UIITEM.ITEM_LEAGUEUNIT:
        case UIITEM.ITEM_UNIT:
        case UIITEM.ITEM_CLANMEMBERELEMENT:
        case UIITEM.ITEM_CLANBOARDELEMENT:
        case UIITEM.ITEM_RANKINGELEMENT:
        case UIITEM.ITEM_FRIENDELEMENT:
        case UIITEM.ITEM_NEWSELEMENT:
        case UIITEM.ITEM_GAINITEM:
        case UIITEM.ITEM_STOREELEMENT:
        case UIITEM.ITEM_STOREPACKAGEELEMENT:
        case UIITEM.ITEM_CLANMARKLIST:
        case UIITEM.ITEM_QUESTELEMENT:
        case UIITEM.ITEM_CHATELEMENT:
        case UIITEM.ITEM_EQUIPITEM:
        case UIITEM.ITEM_CLANLISTELEMENT:
        case UIITEM.ITEM_GAMEINVITEELEMENT:
        case UIITEM.ITEM_RESULTUNITSLOT:
            _uibase = InstantiateUI(_uiItem, _parentTr);
            break;
        }

        return(_uibase);
    }
    }// end of function

    public UI_Base InstantiateUI(UIITEM _uiItem, Transform _parentTr)
    {
        GameObject orinUI  = ObjectPoolManager.Getinstance.Get_ObjectUI(_uiItem.ToString()).gameObject;
        GameObject CloneUI = Instantiate(orinUI);

        CloneUI.transform.SetParent(_parentTr);

        RectTransform _cloneUIRectTr = CloneUI.GetComponent <RectTransform>();
        RectTransform _newUIRectTr   = orinUI.GetComponent <RectTransform>();

        _cloneUIRectTr.sizeDelta        = _newUIRectTr.sizeDelta;
        _cloneUIRectTr.anchoredPosition = _newUIRectTr.anchoredPosition;
        _cloneUIRectTr.localScale       = _newUIRectTr.localScale;

        UI_Base _uibase = CloneUI.GetComponent <UI_Base>();

        //Lst_UiItem.Add(_uibase);

        _uibase.set_Open();


        return(_uibase);
        //Dic_UIunit.Add(_uiunit, _uibase);

        //Dic_UIunit[_uiunit].set_Open();
    }    // end of function
示例#3
0
    public IEnumerator Allocate_UI_Objects()
    {
        UI[] uis = new UI[] { UI.LOBBY, UI.STORE, UI.NEWS, UI.CLAN, UI.RANKING, UI.FRIEND, UI.SETTING, UI.CHAT, UI.TOP, UI.EQUIPMENT, UI.CUSTOMROOM, UI.INGAME_RESULT };

        UIITEM[] uiItems = new UIITEM[] { UIITEM.ITEM_EQUIPITEM, UIITEM.ITEM_CLANMEMBERELEMENT, UIITEM.ITEM_CLANBOARDELEMENT, UIITEM.ITEM_CLANLISTELEMENT
                                          , UIITEM.ITEM_FRIENDELEMENT, UIITEM.ITEM_GAMEINVITEELEMENT, UIITEM.ITEM_RANKINGELEMENT, UIITEM.ITEM_NEWSELEMENT, UIITEM.ITEM_STOREELEMENT, UIITEM.ITEM_CHATELEMENT };

        for (int i = 0; i < uis.Length; i++)
        {
            //로비 프리팹 크기가 이제 크지않으니 씬에 안꺼내놓았다
            //if (uis[i] == UI.LOBBY || uis[i] == UI.SETTING)
            //{
            //	string name = uis[i].ToString();
            //	string findName = string.Empty;
            //	if (uis[i] == UI.LOBBY) findName = "UI_Lobby";
            //	else if (uis[i] == UI.SETTING) findName = "UI_Setting";

            //	GameObject obj1 = GameObject.Find(findName);
            //	//obj1.GetComponent<RectTransform>().offsetMin = new Vector2(590f, 350f);
            //	//obj1.GetComponent<RectTransform>().offsetMax = new Vector2(-590f, -350f);
            //	UI_Base lobbyBase = obj1.GetComponent<UI_Base>();
            //	Op_ObjectUI.AllocateDirect(name, lobbyBase);
            //	//obj1.SetActive(false);
            //	UserEditor.Getsingleton.EditLog(name + " UI 오브젝트 로드 끝 !@#");
            //}
            //else
            {
                ResourceRequest Rq   = new ResourceRequest();
                string          name = uis[i].ToString();
                Rq = Resources.LoadAsync(string.Format("Prefebs/UI_{0}", name));

                yield return(Rq);

                GameObject obj = Rq.asset as GameObject;
                Op_ObjectUI.Allocate(name, obj.GetComponent <UI_Base>());
                UserEditor.Getsingleton.EditLog(name + " UI 오브젝트 로드 끝 !@#");
            }
        }

        //for (int i = 0; i < uiItems.Length; i++ )
        //{
        //    ResourceRequest Rq = new ResourceRequest();
        //    string name = uiItems[i].ToString();
        //    Rq = Resources.LoadAsync(string.Format("Prefebs/UI_{0}", name));

        //    yield return Rq;
        //    GameObject obj = Rq.asset as GameObject;
        //    Op_ObjectUI.Allocate(name, obj.GetComponent<UI_Base>());
        //    UserEditor.Getsingleton.EditLog(name + " UIITEM 오브젝트 로드 끝 !@#");
        //}
    }