public override void LateInit()
    {
        base.LateInit();


        string nickName = NetData.instance.Nickname;
        string _lvStr   = string.Format(_LowDataMgr.instance.GetStringCommon(453), NetData.instance.UserLevel);

        NameAndLvLabel.text = string.Format("{0} {1}", _lvStr, nickName);
        AttackLabel.text    = string.Format("{0} {1:#,#}", _LowDataMgr.instance.GetStringCommon(47), CharInven._TotalAttack);


        //장착중인 파트너 생성
        NetData._CostumeData equipCostumeData = CharInven.GetEquipCostume();
        uint weaponId = 0, clothId = 0, headId = 0;

        if (CharInven.isHideCostum)
        {
            NetData._ItemData head   = CharInven.GetEquipParts(ePartType.HELMET);
            NetData._ItemData cloth  = CharInven.GetEquipParts(ePartType.CLOTH);
            NetData._ItemData weapon = CharInven.GetEquipParts(ePartType.WEAPON);

            if (head != null)
            {
                headId = head._equipitemDataIndex;
            }

            if (cloth != null)
            {
                clothId = cloth._equipitemDataIndex;
            }

            if (weapon != null)
            {
                weaponId = weapon._equipitemDataIndex;
            }
        }

        UIHelper.CreatePcUIModel("FreefightPanel", PlayCharRoot, CharInven.GetCharIdx(), headId, equipCostumeData._costmeDataIndex, clothId, weaponId, CharInven.GetEquipSKillSet().SkillSetId, 3, CharInven.isHideCostum, false);

        if (SceneManager.instance.CurTutorial == TutorialType.FREEFIGHT)
        {
            OnSubTutorial();
        }
    }
    void SetMaterialReadyPopup()
    {
        string nickName = NetData.instance.Nickname;
        string _lvStr   = string.Format(_LowDataMgr.instance.GetStringCommon(453), NetData.instance.UserLevel);

        charNameLv.text = string.Format("{0} {1}", _lvStr, nickName);


        //장착중인 파트너 생성
        NetData._CostumeData equipCostumeData = CharInven.GetEquipCostume();
        uint weaponId = 0, clothId = 0, headId = 0;

        if (CharInven.isHideCostum)
        {
            NetData._ItemData head   = CharInven.GetEquipParts(ePartType.HELMET);
            NetData._ItemData cloth  = CharInven.GetEquipParts(ePartType.CLOTH);
            NetData._ItemData weapon = CharInven.GetEquipParts(ePartType.WEAPON);

            if (head != null)
            {
                headId = head._equipitemDataIndex;
            }

            if (cloth != null)
            {
                clothId = cloth._equipitemDataIndex;
            }

            if (weapon != null)
            {
                weaponId = weapon._equipitemDataIndex;
            }
        }

        UIHelper.CreatePcUIModel("DungeonPanel", PlayCharRoot, CharInven.GetCharIdx(), headId, equipCostumeData._costmeDataIndex, clothId, weaponId, CharInven.GetEquipSKillSet().SkillSetId, 3, CharInven.isHideCostum, false);

        NetData._PartnerData partner_0 = CharInven.GetEquipPartner(1);
        NetData._PartnerData partner_1 = CharInven.GetEquipPartner(2);

        if (partner_0 != null)
        {
            Transform modelRoot = PartnerModelRoot[0];
            PnTouchObj[0].SetActive(false);//터치 라벨 끈다.
            PnTouchEff[0].SetActive(false);
            PartnerModelRoot[0].gameObject.SetActive(true);

            UIHelper.CreatePartnerUIModel(modelRoot, partner_0._partnerDataIndex, 3, true, false, "DungeonPanel");
            string lvStr = string.Format(_LowDataMgr.instance.GetStringCommon(453), partner_0._NowLevel);
            TakeParNames[0].text = string.Format("{0} {1}", lvStr, partner_0.GetLocName());
        }
        else
        {
            PnTouchObj[0].SetActive(true);//터치 라벨 킨다.
            PnTouchEff[0].SetActive(true);
            PartnerModelRoot[0].gameObject.SetActive(false);
            TakeParNames[0].text = "";
        }

        if (partner_1 != null)
        {
            Transform modelRoot = PartnerModelRoot[1];
            PnTouchObj[1].SetActive(false);//터치 라벨 끈다.
            PnTouchEff[1].SetActive(false);
            PartnerModelRoot[1].gameObject.SetActive(true);

            UIHelper.CreatePartnerUIModel(modelRoot, partner_1._partnerDataIndex, 3, true, false, "DungeonPanel");
            string lvStr = string.Format(_LowDataMgr.instance.GetStringCommon(453), partner_1._NowLevel);
            TakeParNames[1].text = string.Format("{0} {1}", lvStr, partner_1.GetLocName());
        }
        else
        {
            PnTouchObj[1].SetActive(true);//터치 라벨 킨다.
            PnTouchEff[1].SetActive(true);
            PartnerModelRoot[1].gameObject.SetActive(false);
            TakeParNames[1].text = "";
        }
    }
示例#3
0
    private List <NetData.MessInfo> FreeRoomList; //자유대전방리스트

    public override void Init()
    {
        base.Init();
        UserInfo = NetData.instance.GetUserInfo();
        string lvStr = string.Format(_LowDataMgr.instance.GetStringCommon(453), UserInfo._Level);

        LvName.text = string.Format("{0} {1}", lvStr, NetData.instance.Nickname);
        Attack.text = UserInfo.RefreshTotalAttackPoint().ToString();
        RoomList    = null;

        //상점
        EventDelegate.Set(BottomBtn[0].onClick, delegate() {
            base.Close();
            UIMgr.OpenShopPanel(this);
        });
        //코스튬
        EventDelegate.Set(BottomBtn[1].onClick, delegate()
        {
            base.Close();
            UIMgr.OpenCostume(this);
        });

        SetChannelActive();

        BottomBtn[2].isEnabled = 0 < QuickRoomId ? true : false;             //최소렙 못넘으면 빠른입장안대
        EventDelegate.Set(BottomBtn[2].onClick, delegate() { EnterGo(0); }); //빠른입장

        //내캐릭터
        NetData._CostumeData equipCostume = UserInfo.GetEquipCostume();
        CharModelTf.transform.gameObject.SetActive(true);

        uint weaponId = 0, clothId = 0, headId = 0;

        if (UserInfo.isHideCostum)
        {
            NetData._ItemData head   = UserInfo.GetEquipParts(ePartType.HELMET);
            NetData._ItemData cloth  = UserInfo.GetEquipParts(ePartType.CLOTH);
            NetData._ItemData weapon = UserInfo.GetEquipParts(ePartType.WEAPON);

            if (head != null)
            {
                headId = head._equipitemDataIndex;
            }

            if (cloth != null)
            {
                clothId = cloth._equipitemDataIndex;
            }

            if (weapon != null)
            {
                weaponId = weapon._equipitemDataIndex;
            }
        }


        UIHelper.CreatePcUIModel("FreefightPanel", CharModelTf, UserInfo.GetCharIdx(), headId, equipCostume._costmeDataIndex, clothId, weaponId, UserInfo.GetEquipSKillSet().SkillSetId, 3, UserInfo.isHideCostum, false);

        NetworkClient.instance.SendPMsgMessQueryC();//조회
        GetRoomList();
    }
示例#4
0
    public override void LateInit()
    {
        base.LateInit();

        GameMode  = (GAME_MODE)parameters[0];
        BasePanel = (UIBasePanel)parameters[1];
        int   energe = (int)parameters[2];
        int   max    = (int)parameters[3];
        float scale  = PartnerModelRoot[0].localScale.x;//파트너는 이값으로

        bool   isNetwork   = false;
        string startBtnLbl = null;

        switch (GameMode)
        {
        case GAME_MODE.SINGLE:
        {
            //모험모드일때만 체력표시되게해주세요
            UIMgr.instance.TopMenu.MenuType[3].transform.parent.gameObject.SetActive(true);
            startBtnLbl = string.Format("{0} ({1} {2})", _LowDataMgr.instance.GetStringCommon(66), energe, _LowDataMgr.instance.GetStringCommon(1));        //("시작"), ("에너지")
            break;
        }


        case GAME_MODE.SPECIAL_EXP:
        case GAME_MODE.SPECIAL_GOLD:
        case GAME_MODE.RAID:
        case GAME_MODE.TOWER:
            startBtnLbl = string.Format("{0}/{1} {2}", max - energe, max, _LowDataMgr.instance.GetStringCommon(66));
            break;

        case GAME_MODE.COLOSSEUM:
        case GAME_MODE.MULTI_RAID:
            isNetwork   = true;
            startBtnLbl = string.Format("{0}/{1} {2}", max - energe, max, _LowDataMgr.instance.GetStringCommon(66));
            scale       = 0.8f;//플레이어는 이값으로
            break;

        case GAME_MODE.ARENA:
            startBtnLbl = string.Format("{0}", _LowDataMgr.instance.GetStringCommon(1053));
            //transform.FindChild("BtnStartGame").collider.enabled = false;
            break;

        default:
            startBtnLbl = "unDefined 0";
            break;
        }

        NetInfoTf.gameObject.SetActive(isNetwork);
        transform.FindChild("Partner").gameObject.SetActive(!isNetwork);
        transform.FindChild("BtnStartGame").gameObject.SetActive(!isNetwork);//상황따라 꺼놓는다.

        PartnerModelRoot[0].localScale = new Vector3(scale, scale, scale);
        PartnerModelRoot[1].localScale = new Vector3(scale, scale, scale);

        IsRoom = isNetwork;
        if (isNetwork)
        {
            InitNetworkDungeon(startBtnLbl);
        }
        else
        {
            transform.FindChild("BtnStartGame/need_food").GetComponent <UILabel>().text = startBtnLbl;

            //캐릭터 닉네임, 레벨 셋팅
            string nickName = NetData.instance.Nickname;
            string lvStr    = string.Format(_LowDataMgr.instance.GetStringCommon(453), NetData.instance.UserLevel);
            transform.FindChild("Character/CharView/CharSlot/player_name").GetComponent <UILabel>().text =
                string.Format("{0} {1}", lvStr, nickName);

            //플레이어 생성
            NetData._CostumeData equipCostumeData = CharInven.GetEquipCostume();
            uint weaponId = 0, clothId = 0, headId = 0;
            if (CharInven.isHideCostum)
            {
                NetData._ItemData head   = CharInven.GetEquipParts(ePartType.HELMET);
                NetData._ItemData cloth  = CharInven.GetEquipParts(ePartType.CLOTH);
                NetData._ItemData weapon = CharInven.GetEquipParts(ePartType.WEAPON);

                if (head != null)
                {
                    headId = head._equipitemDataIndex;
                }

                if (cloth != null)
                {
                    clothId = cloth._equipitemDataIndex;
                }

                if (weapon != null)
                {
                    weaponId = weapon._equipitemDataIndex;
                }
            }

            UIHelper.CreatePcUIModel("ReadyPopup", PlayCharRoot, CharInven.GetCharIdx(), headId, equipCostumeData._costmeDataIndex, clothId, weaponId, CharInven.GetEquipSKillSet().SkillSetId, 0, CharInven.isHideCostum, false);
        }

        if (GameMode != GAME_MODE.COLOSSEUM && GameMode != GAME_MODE.MULTI_RAID)//파트너못대려가는 지역.
        {
            Transform parBtnTf = transform.FindChild("Character/CharView");
            EventDelegate.Set(parBtnTf.FindChild("BtnPartnerSlot_0").GetComponent <UIEventTrigger>().onClick, delegate() { OnClickPartnerRoot(0); });
            EventDelegate.Set(parBtnTf.FindChild("BtnPartnerSlot_1").GetComponent <UIEventTrigger>().onClick, delegate() { OnClickPartnerRoot(1); });
            //CanNotTakePartner.SetActive(false);

            //슬롯 셋팅
            int ownCount = 0;
            List <NetData._PartnerData> dataList = CharInven.GetPartnerList();
            if (PartnerGrid.childCount < dataList.Count)
            {
                int loopCount = dataList.Count;
                for (int i = 0; i < loopCount; i++)
                {
                    Transform slotTf = null;
                    if (i < PartnerGrid.childCount)
                    {
                        slotTf = PartnerGrid.GetChild(i);
                    }
                    else
                    {
                        GameObject slotGo = Instantiate(PartnerSlotPrefab) as GameObject;
                        slotTf               = slotGo.transform;
                        slotTf.parent        = PartnerGrid;
                        slotTf.localPosition = Vector3.zero;
                        slotTf.localScale    = Vector3.one;
                    }

                    NetData._PartnerData data = dataList[i];
                    if (!data._isOwn)
                    {
                        slotTf.gameObject.SetActive(false);
                        continue;
                    }

                    slotTf.name = string.Format("{0}", data._partnerDataIndex);
                    ++ownCount;
                    slotTf.gameObject.SetActive(true);

                    UIButton uiBtn = slotTf.GetComponent <UIButton>();
                    EventDelegate.Set(uiBtn.onClick, delegate()
                    {
                        OnClickAddPartner(data);
                    });

                    UISprite faceIcon    = slotTf.FindChild("face_d3").GetComponent <UISprite>();
                    UISprite gradeIcon   = slotTf.FindChild("grade").GetComponent <UISprite>();
                    UISprite gradebgIcon = slotTf.FindChild("grade_bg").GetComponent <UISprite>();
                    UILabel  nameLbl     = slotTf.FindChild("partner_name_d4").GetComponent <UILabel>();
                    nameLbl.text           = data.GetLocName();
                    faceIcon.spriteName    = data.GetIcon();
                    gradeIcon.spriteName   = string.Format("Icon_0{0}", data.CurQuality);
                    gradebgIcon.spriteName = string.Format("Icon_bg_0{0}", data.CurQuality);

                    if (!data._isEquip)//장착중이 아니면
                    {
                        slotTf.FindChild("face_d3").GetComponent <UISprite>().color = Color.white;
                        continue;
                    }

                    //장착중인 것 셋팅
                    //등록한 파트너 슬롯 딤처리
                    slotTf.FindChild("face_d3").GetComponent <UISprite>().color = Color.gray;
                    PnRootInfo[data._SlotNumber - 1].SetModel(data._partnerDataIndex);
                }

                UIScrollView scroll = PartnerGrid.parent.GetComponent <UIScrollView>();
                if (4 < ownCount)
                {
                    scroll.enabled = true;
                }
                else
                {
                    if (ownCount <= 0)
                    {
                        NotPartner.SetActive(true);
                    }
                    else
                    {
                        NotPartner.SetActive(false);
                    }

                    scroll.enabled = false;
                }

                if (0 < ownCount)
                {
                    GameObject effGo_01 = UIHelper.CreateEffectInGame(PnTouchEff[0].transform, "Fx_UI_partner_select_01", false);
                    GameObject effGo_02 = UIHelper.CreateEffectInGame(PnTouchEff[1].transform, "Fx_UI_partner_select_01", false);
                    effGo_01.transform.localEulerAngles = Vector3.zero;
                    effGo_02.transform.localEulerAngles = Vector3.zero;

                    effGo_01.layer = LayerMask.NameToLayer("UI");
                    effGo_02.layer = LayerMask.NameToLayer("UI");
                    effGo_01.transform.SetChildLayer(LayerMask.NameToLayer("UI"));
                    effGo_02.transform.SetChildLayer(LayerMask.NameToLayer("UI"));

                    PnTouchEff[0].SetActive(true);
                    PnTouchEff[1].SetActive(false);
                }
            }

            //장착중인 파트너 생성
            NetData._PartnerData partner_0 = CharInven.GetEquipPartner(1);
            NetData._PartnerData partner_1 = CharInven.GetEquipPartner(2);
            if (partner_0 != null)
            {
                Transform modelRoot = PartnerModelRoot[0];
                PnTouchObj[0].SetActive(false);//터치 라벨 끈다.

                UIHelper.CreatePartnerUIModel(modelRoot, partner_0._partnerDataIndex, 3, true, false, "ReadyPopup");
                string lvStr = string.Format(_LowDataMgr.instance.GetStringCommon(453), partner_0._NowLevel);
                TakeParNames[0].text = string.Format("{0} {1}", lvStr, partner_0.GetLocName());
            }
            else if (0 < ownCount)
            {
                PnTouchObj[0].SetActive(true);//터치 라벨 킨다.
            }
            //else
            //{
            //    PnTouchObj[0].SetActive(true);//터치 라벨 킨다.
            //    TakeParNames[0].text = "";
            //}

            if (partner_1 != null)
            {
                Transform modelRoot = PartnerModelRoot[1];
                PnTouchObj[1].SetActive(false);//터치 라벨 끈다.

                UIHelper.CreatePartnerUIModel(modelRoot, partner_1._partnerDataIndex, 3, true, false, "ReadyPopup");
                string lvStr = string.Format(_LowDataMgr.instance.GetStringCommon(453), partner_1._NowLevel);
                TakeParNames[1].text = string.Format("{0} {1}", lvStr, partner_1.GetLocName());
            }
            else if (0 < ownCount)
            {
                PnTouchObj[1].SetActive(true);//터치 라벨 킨다.
            }
            //else
            //{
            //    PnTouchObj[1].SetActive(true);//터치 라벨 킨다.
            //    TakeParNames[1].text = "";
            //}
        }
        else
        {
            NotPartner.SetActive(false);
        }
    }