Example #1
0
    /// <summary> 코스튬 장착 응답 </summary>
    public void OnPMsgCostume(NetData._CostumeData costume)
    {
        Transform modelTf = null;

        if (GameMode == GAME_MODE.COLOSSEUM || GameMode == GAME_MODE.MULTI_RAID)
        {
            //if (NetData.instance.GameRoomData.OwnerId == CharInven.GetCharUUID())
            if (NetData.instance.GameRoomData.Owner == null)//내가 방장
            {
                modelTf = PlayCharRoot;
            }
            else
            {
                int arr = NetData.instance.GetGameRoomUserArr(CharInven.GetCharUUID());
                modelTf = PartnerModelRoot[arr];
            }
        }
        else
        {
            modelTf = PlayCharRoot;
        }

        CharInven.EquipCostume(costume._costumeIndex);

        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;
            }
        }

        GameObject go = UIHelper.CreatePcUIModel("ReadyPopup", modelTf, CharInven.GetCharIdx(), headId, costume._costmeDataIndex, clothId, weaponId, CharInven.GetEquipSKillSet().SkillSetId, 5, CharInven.isHideCostum, false);

        go.GetComponent <UIModel>().CrossFadeAnimation(eAnimName.Anim_skill8, eAnimName.Anim_idle);

        Transform slotTf = CostumGrid.FindChild(string.Format("{0}", costume._costmeDataIndex));

        slotTf.FindChild("mount").gameObject.SetActive(true);
        slotTf.FindChild("btn_insert").collider.enabled = false;
        UILabel nameLb = slotTf.FindChild("state_d3").GetComponent <UILabel>();

        nameLb.text = _LowDataMgr.instance.GetStringCommon(37); //("장착중");

        //기존꺼 수정하기
        CostumMountIconTf.parent.FindChild("mount").gameObject.SetActive(false);
        CostumMountIconTf.parent.FindChild("btn_insert").collider.enabled        = true;
        CostumMountIconTf.parent.FindChild("bg").GetComponent <UISprite>().color = new Color(1, 1, 1, 0.3f);
        UILabel lbl = CostumMountIconTf.parent.FindChild("state_d3").GetComponent <UILabel>();

        lbl.text = _LowDataMgr.instance.GetStringCommon(38); //("장착하기");

        CostumMountIconTf.parent        = slotTf;
        CostumMountIconTf.localPosition = Vector3.zero;
        CostumMountIconTf.localScale    = Vector3.one;
        slotTf.FindChild("bg").GetComponent <UISprite>().color = Color.white;

        TownState town = SceneManager.instance.GetState <TownState>();

        town.MyHero.SetChangeSkin(true);
    }