/// <summary> 아이템 상세 팝업 </summary> static public ItemDetailPopup OpenDetailPopup(UIBasePanel basePanel, NetData._ItemData itemData = null, int depth = 3, bool isAutoQ = false) { string path = "UIPopup/DetailPopup"; GameObject go = Open(path, isAutoQ, depth, basePanel, itemData); return(go.GetComponent <ItemDetailPopup>()); }
/// <summary> 사용 아이템의 설명문 Equip아이템은 아님. 마지막 셋팅 함수임. Position은 주지 않는다 </summary> void SetDesc(NetData._ItemData itemData, ref byte optionCount) { uint descId = 0; if (itemData.IsEquipItem()) { Item.EquipmentInfo equipLowData = itemData.GetEquipLowData(); descId = equipLowData.DescriptionId; } else { Item.ItemInfo useLowData = itemData.GetUseLowData(); descId = useLowData == null ? 0 : useLowData.DescriptionId; } if (descId <= 0) { Desc.gameObject.SetActive(false); return; } ++optionCount; Desc.gameObject.SetActive(true); Desc.text = _LowDataMgr.instance.GetStringItem(descId); }
/// <summary> 아이템 상세 팝업 </summary> static public ItemDetailPopup OpenDetailPopup(UIBasePanel basePanel, uint itemLowData, int depth = 6, bool isAutoQ = false) { NetData._ItemData itemData = new NetData._ItemData(itemLowData, itemLowData, 0, 0, false); string path = "UIPopup/DetailPopup"; GameObject go = Open(path, isAutoQ, depth, basePanel, itemData); return(go.GetComponent <ItemDetailPopup>()); }
/// <summary> 아이템의 상세정보 팝업 </summary> void OpenDetailPopup(NetData._ItemData itemData, uint itemIdx) { UIBasePanel partner = UIMgr.GetUIBasePanel("UIPanel/PartnerPanel"); if (itemData == null) { UIMgr.OpenDetailPopup(partner, itemIdx, 5); } else { UIMgr.OpenDetailPopup(partner, itemData, 5); } }
/// <summary> 장착중인 아이템 슬롯 셋팅 </summary> public void SetMountItemSlot(NetData._ItemData itemData, Action <ulong> callBack, uint key) { EnchantLv.gameObject.SetActive(itemData.IsEquipItem()); if (itemData == null)//장착중인 아이템이 없다 다 꺼놓는다. { EmptySlot(); } else//장착중인 아이템이 있다 아이템 셋팅한다 { SetEquipItem(itemData.GetEquipLowData(), 0); EnchantLv.text = string.Format("+{0}", itemData._enchant); Key = key; CallBack = callBack; } }
void SetItemSlot(uint itemid, Transform itemTf) { Item.ItemInfo itemInfo = _LowDataMgr.instance.GetUseItem(itemid); UISprite iconSp = itemTf.FindChild("icon").GetComponent <UISprite>(); if (itemInfo.Type == (byte)AssetType.CostumeShard || itemInfo.Type == (byte)AssetType.PartnerShard) { iconSp.atlas = AtlasMgr.instance.GetLoadAtlas(LoadAtlasType.Shard); } iconSp.spriteName = _LowDataMgr.instance.GetLowDataIcon(itemInfo.Icon); itemTf.FindChild("grade").GetComponent <UISprite>().spriteName = string.Format("Icon_0{0}", itemInfo.Grade); NetData._ItemData item = NetData.instance.GetUserInfo().GetItemForItemID(itemid, (byte)eItemType.USE); if (item != null) { itemTf.FindChild("new").gameObject.SetActive(item.IsNewItem); itemTf.FindChild("disable").gameObject.SetActive(false); itemTf.FindChild("stack").GetComponent <UILabel>().text = item.Count.ToString(); item.IsNewItem = false;//바로 꺼준다.Hide에서 처리해도 되지만 여기서 처리해보도록한다 } else { itemTf.FindChild("new").gameObject.SetActive(false); itemTf.FindChild("disable").gameObject.SetActive(true); itemTf.FindChild("stack").GetComponent <UILabel>().text = "0"; } EventDelegate.Set(itemTf.GetComponent <UIEventTrigger>().onClick, () => { if (SceneManager.instance.CurTutorial == TutorialType.CATEGORY) { if (itemTf.GetComponent <TutorialSupport>() == null)//스킵 { UIBasePanel basePanel = UIMgr.GetUIBasePanel("UIPopup/TutorialPopup"); if (basePanel != null) { SceneManager.instance.CurTutorial = SceneManager.instance.CurTutorial;//다음으로 넘김. basePanel.Close(); } } } UIMgr.OpenDetailPopup(this, itemInfo.Id, 7); }); }
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(); } }
/// <summary> 인벤토리의 아이템 정의 </summary> /// <param name="itemData">셋팅하고자 하는 아이템데이터</param> /// <param name="startDepth">시작 뎁스 값</param> public void SetInvenItemSlot(NetData._ItemData itemData, Action <ulong, byte> callBack, int startDepth = 8) { EnchantLv.gameObject.SetActive(itemData.IsEquipItem()); if (itemData.IsEquipItem()) { SetEquipItem(itemData.GetEquipLowData(), itemData.Count); EnchantLv.text = itemData._enchant <= 0 ? "" : string.Format("+{0}", itemData._enchant); } else { SetUseItem(itemData.GetUseLowData(), itemData.Count); } Key = itemData._itemIndex; Key2 = itemData._itemType; CallBackTwo = callBack; SetDepth(startDepth); }
void ShowItem(NetData._ItemData recomend) { Name.text = recomend.GetLocName(); Item.EquipmentInfo equipLowData = recomend.GetEquipLowData(); Img.spriteName = _LowDataMgr.instance.GetLowDataIcon(equipLowData.Icon); Bg.spriteName = string.Format("Icon_bg_0{0}", equipLowData.Grade); Grade.spriteName = string.Format("Icon_0{0}", equipLowData.Grade); Attack.text = string.Format("{0} : {1}", _LowDataMgr.instance.GetStringCommon(47), recomend._Attack.ToString()); //UIEventTrigger etri = transform.FindChild("Bg").GetComponent<UIEventTrigger>(); //EventDelegate.Set(etri.onClick, delegate () { OnclicItemPopup(Img.transform, recomend._equipitemDataIndex); }); if (SceneManager.instance.testData.bSingleSceneTestStart || SceneManager.instance.testData.bQuestTestStart) { TempCoroutine.instance.FrameDelay(0.5f, () => { OnClickChanged(); }); } }
int SortJewel(NetData._ItemData a, NetData._ItemData b) { if (!a.IsUseItem() || !b.IsUseItem()) { return(0); } Item.ItemInfo aLowData = a.GetUseLowData(); Item.ItemInfo bLowData = b.GetUseLowData(); AssetType aType = (AssetType)aLowData.Type; AssetType bType = (AssetType)bLowData.Type; //보석은 별도 if (aType == AssetType.Jewel && bType == AssetType.Jewel) { if (aLowData.Grade < bLowData.Grade) { return(1); } else if (bLowData.Grade < aLowData.Grade) { return(-1); } } else if (aType != AssetType.Jewel && bType == AssetType.Jewel) { return(1); } else if (aType == AssetType.Jewel && bType != AssetType.Jewel) { return(-1); } if (a._itemIndex < b._itemIndex) { return(-1); } else { return(1); } }
/// <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); }
/// <summary> 아이템상세팝업에서 보석 삽입 버튼 클릭 했으면 실행. </summary> public void OnInsertJewel(NetData._ItemData itemData) { NetData._CostumeData costumeData = UserInfo.GetEquipCostume(); NetworkClient.instance.SendPMsgCostumeTokenC((int)costumeData._costumeIndex, 1, (int)itemData._itemIndex, SelectJewelArr + 1); }
/// <summary> 아이템 클릭시 실행. </summary> void OnClickInvenItemSlot(ulong itemIdx, byte itemType) { NetData._ItemData itemData = UserInfo.GetItemDataForIndexAndType(itemIdx, itemType); //DetailPopup.SetDetailPopup(itemData); UIMgr.OpenDetailPopup(this, itemData); }
public void UserCharInfo(uint charIdx, uint skillSetId, NetData._ItemData[] equipList, NetData._CostumeData costume, bool hideCostume) { CurCostumStatus.text = costume.GetLocName(); string lvAndName = string.Format(_LowDataMgr.instance.GetStringCommon(453), UserLv); UserNameLbl.text = string.Format("{0} {1}", lvAndName, UserName); uint helmet = 0, cloth = 0, weapon = 0; for (int i = 0; i < EquipPartsTf.childCount; i++) { Transform tf = EquipPartsTf.GetChild(i); if (tf == null) { continue; } UIEventTrigger uiTri = tf.GetComponent <UIEventTrigger>(); UISprite bg = tf.GetComponent <UISprite>(); UISprite grade = tf.FindChild("grade").GetComponent <UISprite>(); UISprite icon = tf.FindChild("icon").GetComponent <UISprite>(); UILabel enchantLv = tf.FindChild("Num").GetComponent <UILabel>(); if (equipList[i] == null) { icon.enabled = false; grade.enabled = false; bg.spriteName = UIHelper.GetDefaultEquipIcon((ePartType)i + 1); enchantLv.gameObject.SetActive(false); continue; } NetData._ItemData equipData = equipList[i]; if (equipData.EquipPartType == ePartType.HELMET) { helmet = equipData._equipitemDataIndex; } else if (equipData.EquipPartType == ePartType.WEAPON) { weapon = equipData._equipitemDataIndex; } else if (equipData.EquipPartType == ePartType.CLOTH) { cloth = equipData._equipitemDataIndex; } icon.enabled = true; grade.enabled = true; UIAtlas atlas = null; atlas = AtlasMgr.instance.GetEquipAtlasForClassId(equipData.GetEquipLowData().Class); icon.atlas = atlas; icon.spriteName = _LowDataMgr.instance.GetLowDataIcon(equipData.GetEquipLowData().Icon); grade.spriteName = string.Format("Icon_0{0}", equipData.GetEquipLowData().Grade); bg.spriteName = string.Format("Icon_bg_0{0}", equipData.GetEquipLowData().Grade); enchantLv.text = equipData._enchant <= 0 ? "" : string.Format("+{0}", equipData._enchant); enchantLv.gameObject.SetActive(true); EventDelegate.Set(uiTri.onClick, delegate() { if (equipData == null) { return; } UIBasePanel basePanel = UIMgr.GetUIBasePanel("UIPopup/ChatPopup"); if (basePanel == null) { return; } UIMgr.OpenDetailPopup(this, equipData, GetComponent <UIPanel>().depth + 3); }); } //코스튬 화면 UIHelper.CreatePcUIModel("CharacterPanel", RotationTargetList[0].transform, charIdx, helmet, costume._costmeDataIndex , cloth, weapon, skillSetId, 3, hideCostume, false); CharInfoGo.SetActive(true); InfoGo.SetActive(false); }
void OnClickBroadCast(UILabel label) { string url = null; bool isMiniChat = false; if (label != null)// && BigChatPopup.localPosition == Vector3.zero //큰 팝업 켜져있는지 { url = label.GetUrlAtPosition(UICamera.lastHit.point); //url = BigTextList[(uint)CurChatType].textLabel.GetUrlAtPosition(UICamera.lastHit.point); } else//작은 팝업이 켜져있음 { url = MiniTextList.textLabel.GetUrlAtPosition(UICamera.lastHit.point); isMiniChat = true; } if (!TownState.TownActive || string.IsNullOrEmpty(url)) { if (isMiniChat)//유알엘이 아니였음 큰 팝업으로 간주함 { OnClickBigChatPopup(); } return; } //Debug.Log("chat click url " + url); if (url.Contains("colosseum")) { string[] split = url.Split(','); long roomId = 0; if (split.Length < 1 || !long.TryParse(split[1], out roomId)) { Debug.LogError("Colosseum URL Parse error! " + url); return; } NetworkClient.instance.SendPMsgColosseumEnterRoomC(roomId); } else if (url.Contains("multyRaid")) { string[] split = url.Split(','); long roomId = 0; if (split.Length < 1 || !long.TryParse(split[1], out roomId)) { Debug.LogError("Colosseum URL Parse error! " + url); return; } NetworkClient.instance.SendPMsgMultiBossEnterRoomC(roomId); } else if (url.Contains("item")) { string[] split = url.Split('/'); if (split.Length < 1) { Debug.LogError("Item URL pase error! " + url); return; } Debug.Log(url); string[] equipInfo = split[1].Split(','); int unId = int.Parse(equipInfo[0]); //int unBasicValue = int.Parse(equipInfo[1]); int unAttack = int.Parse(equipInfo[1]); int unEnchantTime = int.Parse(equipInfo[2]); string[] optionInfo = split[2].Split('|'); List <NetData.ItemAbilityData> abilityList = new List <NetData.ItemAbilityData>(); NetData._ItemData itemData = new NetData._ItemData((ulong)unId, (uint)unId, (ushort)unEnchantTime, 0, 0, (uint)unAttack); //Item.ItemValueInfo basicInfo = _LowDataMgr.instance.GetLowDataItemValueInfo(itemData.GetEquipLowData().BasicOptionIndex); //if (basicInfo != null) //{ // NetData.ItemAbilityData abilityData = new NetData.ItemAbilityData(); // abilityData.Ability = (AbilityType)basicInfo.OptionId; // abilityData.Value = unBasicValue; // abilityList.Add(abilityData); //} for (int i = 0; i < optionInfo.Length; i++) { string[] ability = optionInfo[i].Split(','); uint id = uint.Parse(ability[0]); float value = float.Parse(ability[1]); Item.ItemValueInfo itemValue = _LowDataMgr.instance.GetLowDataItemValueInfo(id); abilityList.Add(new NetData.ItemAbilityData(itemValue.OptionId, value)); } itemData.StatList = abilityList; UIMgr.OpenDetailPopup(this, itemData, GetComponent <UIPanel>().depth + 3); } }
/// <summary> 아이템 디테일 팝업 실행 함수. </summary> void SetDetailPopup(NetData._ItemData itemData) { CurItemData = itemData; Debug.Log(string.Format("Click Item UseId={0}, equipId={1}", itemData._useitemDataIndex, itemData._equipitemDataIndex)); bool isDifferentClass = false; NetData._UserInfo charInven = NetData.instance.GetUserInfo(); if (CurItemData.IsEquipItem()) { LinkPopup[0].SetActive(false); LinkPopup[1].SetActive(false); int limitLv = CurItemData.GetEquipLowData().LimitLevel; //EquipLv.text = string.Format(_LowDataMgr.instance.GetStringCommon(952), limitLv); if (limitLv <= charInven._Level && !isDifferentClass)//내 직업이고 레벨이 높다면 { EquipState[0].SetActive(true); EquipState[1].SetActive(false); } else { EquipState[0].SetActive(false); EquipState[1].SetActive(true); } uint strKey = 0; if (BasePanel is EquipmentPanel) { Item.EquipmentInfo equipLow = CurItemData.GetEquipLowData(); if (CurItemData._enchant < equipLow.MaxEnchant) { strKey = 31; } else if (0 < equipLow.NextPartsId) { strKey = 32; } else//최대 { strKey = 1182; } } else { strKey = 106;//닫기 } if (0 < strKey) { SetOnOff(MainBtn.transform, true, _LowDataMgr.instance.GetStringCommon(strKey)); } //텍스트 셋팅 int grade = itemData.GetEquipLowData().Grade; string color = UIHelper.GetItemGradeColor(grade); ItemName.text = string.Format("{0}{1}[-] [FFE400]+{2}[-]", color, itemData.GetLocName(), itemData._enchant); } else { //EquipLv.text = ""; EquipState[0].SetActive(false); EquipState[1].SetActive(false); LinkPopup[0].SetActive(true); LinkPopup[1].SetActive(false); SetOnOff(MainBtn.transform, true, _LowDataMgr.instance.GetStringCommon(106)); int count = charInven.GetItemCountForItemId(CurItemData._useitemDataIndex, (byte)eItemType.USE); LinkItemSlot[0].SetLowDataItemSlot(CurItemData._useitemDataIndex, (uint)count); LinkItemSlot[0].transform.parent.FindChild("Lock").gameObject.SetActive(count <= 0); Transform gridTf = LinkScroll.transform.FindChild("Grid"); List <Item.ContentsListInfo> conList = _LowDataMgr.instance.GetLowDataContentsItemList(CurItemData._useitemDataIndex); for (int i = 0; i < conList.Count; i++) { Item.ContentsListInfo info = conList[i]; string contentsName = _LowDataMgr.instance.GetStringCommon(info.ContentsName); if (info.ContentsParam != null && 0 < info.ContentsParam.Count) { if (contentsName.Contains("{0}") && contentsName.Contains("{1}")) { contentsName = string.Format(contentsName, info.ContentsParam[0], info.ContentsParam[1]); } else if (contentsName.Contains("{0}")) { contentsName = string.Format(contentsName, info.ContentsParam[0]); } } Transform tf = null; if (i < gridTf.childCount) { tf = gridTf.GetChild(i); } else { tf = Instantiate(gridTf.GetChild(0)) as Transform; tf.parent = gridTf; tf.localScale = Vector3.one; } tf.gameObject.SetActive(true); tf.FindChild("txt").GetComponent <UILabel>().text = contentsName; bool isEnter = true; if (CheckContentsLink(info, false))//조건 만족 { tf.FindChild("error_txt").GetComponent <UILabel>().text = ""; } else { isEnter = false; string contentsError = _LowDataMgr.instance.GetStringCommon(info.ConditionName); if (info.ConditionParam != null && 0 < info.ConditionParam.Count) { if (contentsError.Contains("{0}") && contentsError.Contains("{1}")) { contentsError = string.Format(contentsError, info.ConditionParam[0], info.ConditionParam[1]); } else if (contentsError.Contains("{0}")) { contentsError = string.Format(contentsError, info.ConditionParam[0]); } } tf.FindChild("error_txt").GetComponent <UILabel>().text = contentsError; } EventDelegate.Set(tf.FindChild("Btn").GetComponent <UIEventTrigger>().onClick, () => { OnClickContentsLink(info); }); if (info.ContentsLinkType == 1)//재료조합 { tf.FindChild("Btn/On/label").GetComponent <UILabel>().text = _LowDataMgr.instance.GetStringCommon(39); tf.FindChild("Btn/Off/label").GetComponent <UILabel>().text = _LowDataMgr.instance.GetStringCommon(39); } else if (info.ContentsLinkType == 2)//바로가기(던전) { tf.FindChild("Btn/On/label").GetComponent <UILabel>().text = _LowDataMgr.instance.GetStringCommon(249); tf.FindChild("Btn/Off/label").GetComponent <UILabel>().text = _LowDataMgr.instance.GetStringCommon(249); } tf.FindChild("Btn/On").gameObject.SetActive(isEnter); tf.FindChild("Btn/Off").gameObject.SetActive(!isEnter); } gridTf.GetComponent <UIGrid>().repositionNow = true; for (int j = conList.Count; j < gridTf.childCount; j++) { gridTf.GetChild(j).gameObject.SetActive(false); } if (conList.Count < 4) { LinkScroll.enabled = false; } else { LinkScroll.enabled = true; } Item.ItemInfo data = itemData.GetUseLowData(); string color = UIHelper.GetItemGradeColor(data == null ? 0 : (int)data.Grade); ItemName.text = string.Format("{0}{1}[-] [FFE400][-]", color, itemData.GetLocName()); } //아이템 셋팅 ItemSlot.SetInvenItemSlot(itemData, null, 0); //아이템의 옵션들 셋팅 byte optionCount = 0; Desc.transform.localPosition = SetAbility(itemData, ref optionCount); //어빌리티 SetDesc(itemData, ref optionCount); //아이템 설명 표현 OptionScrollView.ResetPosition(); if (optionCount <= 1)//스크롤 되면 안됨. { AbilityTf.parent.collider.enabled = false; } else { AbilityTf.parent.collider.enabled = true; } }
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 = ""; } }
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(); }
/// <summary> 아이템의 옵션정보 표기 </summary> Vector3 SetAbility(NetData._ItemData itemData, ref byte optionCount) { for (int i = 0; i < Abilitys.Length; i++) { Abilitys[i].gameObject.SetActive(false); } int abilityCount = 0; GameObject line = AbilityTf.FindChild("line_d0").gameObject; if (itemData.IsEquipItem())//장비 아이템 { NetData._ItemData mountItemData = NetData.instance.GetUserInfo().GetEquipParts(itemData.EquipPartType); bool isCompare = false; if (mountItemData != null) //같은 파츠이면서 착용한 아이템과 다르다면 비교한다. { if (mountItemData.GetEquipLowData().Class == itemData.GetEquipLowData().Class) //같은 직업군인지 { isCompare = mountItemData._itemIndex != itemData._itemIndex; } } List <NetData.ItemAbilityData> statList = itemData.StatList; abilityCount = statList.Count; for (int i = 0; i < abilityCount; i++) { //float value = (statList[i].Value * 0.1f) + (itemData._enchant + ((itemData._Grade * 10) + itemData._MinorGrade)); int value = _LowDataMgr.instance.GetItemAbilityValueToInt(statList[i].Value, itemData._enchant); Abilitys[i].text = string.Format("{0} {1}", uiMgr.GetAbilityLocName(statList[i].Ability), value); Abilitys[i].gameObject.SetActive(true); } } else//사용 아이템 { abilityCount = itemData.StatList.Count; for (int i = 0; i < abilityCount; i++) { NetData.ItemAbilityData data = itemData.StatList[i]; Abilitys[i].text = string.Format("{0} {1}", uiMgr.GetAbilityLocName(data.Ability) , uiMgr.GetAbilityStrValue(data.Ability, data.Value * 0.1f)); Abilitys[i].gameObject.SetActive(true); } } if (abilityCount == 0)//Option이 없다. 꺼놓고 자신의 좌표를 준다. { AbilityTf.gameObject.SetActive(false); return(AbilityTf.localPosition); } ++optionCount; ++abilityCount; AbilityTf.gameObject.SetActive(true); ///Line 그리기 Transform lineTf = AbilityTf.FindChild("line_d0"); Vector3 linePos = lineTf.localPosition; linePos.y = -(abilityCount * 27); lineTf.localPosition = linePos; ///다음에 올 객체에 관한 포지션 값 Vector3 pos = AbilityTf.localPosition; pos.y += (linePos.y - 27); return(pos); }
/// <summary> 콜로세움, 멀티보스레이드 </summary> void InitNetworkDungeon(string startBtnLbl) { NetInfoTf.FindChild("BtnStart/need_food").GetComponent <UILabel>().text = startBtnLbl; uint stageId = (uint)parameters[4]; uint limitPower = 0; if (GameMode == GAME_MODE.COLOSSEUM) { DungeonTable.ColosseumInfo coloInfo = _LowDataMgr.instance.GetLowDataColosseumInfo(stageId); limitPower = coloInfo.FightingPower; } else { DungeonTable.MultyBossRaidInfo multyInfo = _LowDataMgr.instance.GetLowDataMultyBossInfo(stageId); limitPower = multyInfo.FightingPower; } NetInfoTf.FindChild("BattlePoint/my").GetComponent <UILabel>().text = string.Format("{0} : {1}", _LowDataMgr.instance.GetStringCommon(725), CharInven._TotalAttack); NetInfoTf.FindChild("BattlePoint/limit").GetComponent <UILabel>().text = string.Format("{0} : {1}", _LowDataMgr.instance.GetStringCommon(724), limitPower); Transform parBtnTf = transform.FindChild("Character/CharView"); //if (NetData.instance.GameRoomData.OwnerId == CharInven.GetCharUUID() )//내가 방장 NetData.RoomData roomData = NetData.instance.GameRoomData; if (roomData.IsLeader) //내가 방장 { EventDelegate.Set(NetInfoTf.FindChild("BtnStart").GetComponent <UIButton>().onClick, OnClickStartGame); EventDelegate.Set(NetInfoTf.FindChild("BtnTown").GetComponent <UIButton>().onClick, OnInviteTown); EventDelegate.Set(NetInfoTf.FindChild("BtnInvite").GetComponent <UIButton>().onClick, () => { //IsTownInvite = false; UIMgr.OpenInvitePopup(GameMode); //Hide(); }); //캐릭터 닉네임, 레벨 셋팅 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 , 3 , CharInven.isHideCostum , false); EventDelegate.Set(parBtnTf.FindChild("BtnPartnerSlot_0").GetComponent <UIEventTrigger>().onClick, delegate() { OnClickUserSlot(0); }); EventDelegate.Set(parBtnTf.FindChild("BtnPartnerSlot_1").GetComponent <UIEventTrigger>().onClick, delegate() { OnClickUserSlot(1); }); PnTouchObj[0].SetActive(true); PnTouchObj[1].SetActive(true); } else//파티 참가자 { NetInfoTf.FindChild("BtnStart").collider.enabled = false; NetInfoTf.FindChild("BtnTown").collider.enabled = false; NetInfoTf.FindChild("BtnInvite").collider.enabled = false; parBtnTf.FindChild("BtnPartnerSlot_0").collider.enabled = false; parBtnTf.FindChild("BtnPartnerSlot_1").collider.enabled = false; PnTouchObj[0].SetActive(false); PnTouchObj[1].SetActive(false); //캐릭터 닉네임, 레벨 셋팅 //방장 셋팅 string lvStr = string.Format(_LowDataMgr.instance.GetStringCommon(453), roomData.Owner.Lv); transform.FindChild("Character/CharView/CharSlot/player_name").GetComponent <UILabel>().text = string.Format("{0} {1}", lvStr, roomData.Owner.Name); NetworkClient.instance.SendPMsgQueryRoleInfoC((long)roomData.Owner.Id); for (int i = 0; i < roomData.UserList.Count; i++)//파티원들 셋팅 { int arr = roomData.UserList[i].Slot; string lv = string.Format(_LowDataMgr.instance.GetStringCommon(453), roomData.UserList[i].Lv); TakeParNames[arr].text = string.Format("{0} {1}", lv, roomData.UserList[i].Name); if (roomData.UserList[i].Id == CharInven.GetCharUUID())//나 { //플레이어 생성 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" , PartnerModelRoot[arr] , CharInven.GetCharIdx() , headId , equipCostumeData._costmeDataIndex , clothId , weaponId , CharInven.GetEquipSKillSet().SkillSetId , 3 , CharInven.isHideCostum , false); } else { NetworkClient.instance.SendPMsgQueryRoleInfoC((long)roomData.UserList[i].Id); } } } }
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); } }