/// <summary> 스킬 강화버튼 </summary>
    void OnClickSkillLevelup(bool isMax)
    {
        int skillNumber = SkillLevelup.SelectSkillNum + 1;

        IsMaxSkillup = isMax;

        //Debug.Log("skill number " + skillNumber);
        if (skillNumber == 0)//최대레벨
        {
            SceneManager.instance.SetNoticePanel(NoticeType.Message, 635);
            return;
        }

        NetData._CostumeData costumeData = UserInfo.GetEquipCostume();
        NetworkClient.instance.SendPMsgCostumeSkillUpgradeC((int)costumeData._costumeIndex, skillNumber);
    }
    void getModelInfo(NetData._UserInfo inven, ref uint HELMETID, ref uint CLOTHID, ref uint WEAPONID, ref uint CostumeID)
    {
        Item.EquipmentInfo tempInfo = inven.GetEquipPartsLowData(ePartType.HELMET);
        if (tempInfo == null)
        {
            HELMETID = 0;
        }
        else
        {
            HELMETID = tempInfo.Id;
        }

        tempInfo = inven.GetEquipPartsLowData(ePartType.CLOTH);
        if (tempInfo == null)
        {
            CLOTHID = 0;
        }
        else
        {
            CLOTHID = tempInfo.Id;
        }

        tempInfo = inven.GetEquipPartsLowData(ePartType.WEAPON);
        if (tempInfo == null)
        {
            WEAPONID = 0;
        }
        else
        {
            WEAPONID = tempInfo.Id;
        }

        NetData._CostumeData tempCostume = inven.GetEquipCostume();

        if (tempCostume == null)
        {
            if (inven.GetCharIdx() == 11000)
            {
                CostumeID = 100;
            }
            else if (inven.GetCharIdx() == 12000)
            {
                CostumeID = 110;
            }
            else if (inven.GetCharIdx() == 13000)
            {
                CostumeID = 120;
            }
        }
        else
        {
            CostumeID = tempCostume._costmeDataIndex;
        }
    }
    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();
        }
    }
Beispiel #4
0
    IEnumerator TownUILoadUpdate()
    {
        UIBasePanel townPanel = UIMgr.GetTownBasePanel();

        NetData._UserInfo userInfo = NetData.instance.GetUserInfo();
        while (null == userInfo.GetEquipCostume() || townPanel == null)//서버에서 받아올때까지 대기한다
        {
            yield return(new WaitForSeconds(0.1f));

            if (townPanel == null)
            {
                townPanel = UIMgr.GetTownBasePanel();
            }
        }

        //while (_ActivityInfo.IsSend)//서버에서 받아올때까지 대기한다
        //{
        //    yield return new WaitForSeconds(0.1f);
        //}

        IsUILoad = true;

        //(townPanel as TownPanel).ActivityPoint(_ActivityInfo.GetPoint);
        (townPanel as TownPanel).CreatePcFaceObj();
        //Npc
        //List<InputTownModel> npcList = TownNpcMgr.instance.GetNpcList();
        //if (npcList != null)
        //{
        //    int loopCount = npcList.Count;
        //    for (int i = 0; i < loopCount; i++)
        //    {
        //        (townPanel as TownPanel).CreateHeadObjet(npcList[i].gameObject, npcList[i].NPCName, 0, 0, false);
        //    }
        //}


        //yield return new WaitForSeconds(0.1f);

        if (!SceneManager.instance.IsYieldAction)
        {
            SceneManager.instance.ShowLoadingTipPanel(false);
        }
    }
    public override void Init()
    {
        SceneManager.instance.sw.Reset();
        SceneManager.instance.sw.Start();

        SceneManager.instance.showStopWatchTimer("costume panel, Init() start");

        base.Init();

        UserInfo   = NetData.instance.GetUserInfo();
        SkillMaxLv = _LowDataMgr.instance.GetEtcTableValue <int>(EtcID.CharacterMaxSkillLevel);

        Transform gridTf = ViewObj[(uint)ViewType.List].transform.FindChild("ScrollView/Grid");

        if (gridTf.childCount < UserInfo.GetCostumeList().Count) //슬롯에 뿌려줘야 하는 데이터가 더 많다 슬롯 생성한다.
        {
            int createCount = 5;                                 //일단임의로? 이거물어봐야해 //UserInfo.GetCostumeList().Count;
            UIHelper.CreateSlotItem(true, createCount, gridTf.GetChild(0), gridTf, null);
        }

        InitEventButton();

        NetData._CostumeData costumeData = UserInfo.GetEquipCostume();
        CreateCostume(costumeData, false, false);

        string lvStr = string.Format(_LowDataMgr.instance.GetStringCommon(453), NetData.instance.UserLevel);

        UserNickAndLevel.text = string.Format("{0} {1}", lvStr, NetData.instance.Nickname);
        CostumeName.text      = costumeData.GetLocName();//itemInfo.itemName;

        //승급 초기화
        int loopCount = EvolveRootTfs.Length;

        EvolInvenSlots = new InvenItemSlotObject[loopCount];
        for (int i = 0; i < loopCount; i++)
        {
            GameObject slotGo = Instantiate(InvenSlotPrefab) as GameObject;
            Transform  tf     = slotGo.transform;
            tf.parent        = EvolveRootTfs[i];
            tf.localPosition = Vector3.zero;
            tf.localScale    = Vector3.one;

            EvolInvenSlots[i] = slotGo.GetComponent <InvenItemSlotObject>();
            //EvolInvenSlots[i].SetBackGround("Blod_SlotBg02");
        }

        loopCount       = SocketRootTfs.Length;
        JewelInvenSlots = new InvenItemSlotObject[loopCount];
        for (int i = 0; i < loopCount; i++)
        {
            GameObject slotGo = Instantiate(InvenSlotPrefab) as GameObject;
            Transform  tf     = slotGo.transform;
            tf.parent        = SocketRootTfs[i].FindChild("target");
            tf.localPosition = Vector3.zero;
            tf.localScale    = Vector3.one;

            JewelInvenSlots[i] = slotGo.GetComponent <InvenItemSlotObject>();
            JewelInvenSlots[i].EmptySlot();

            UIEventTrigger uiTri   = SocketRootTfs[i].GetComponent <UIEventTrigger>();
            int            slotArr = i;
            EventDelegate.Set(uiTri.onClick, delegate() {
                OnClickJewelSlot(slotArr);
            });
        }

        UILabel label = BtnOnceSkillLevelup.transform.FindChild("label_d6").GetComponent <UILabel>();

        label.text = string.Format(_LowDataMgr.instance.GetStringCommon(45), 1);

        SelectSkillEff = UIHelper.CreateEffectInGame(GetViewObj(ViewType.Skill).transform, "Fx_UI_circle_select").transform;
        SkillUpEff     = UIHelper.CreateEffectInGame(GetViewObj(ViewType.Skill).transform, "Fx_UI_cos_skillup");

        TabGroup.Initialize(OnClickTab);


        SceneManager.instance.showStopWatchTimer("costume panel, Init() finish");
    }
    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 = "";
        }
    }
Beispiel #7
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();
    }
Beispiel #8
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);
        }
    }