public void ShowGetBaby() { if (hasDestroy) { return; } typeObj.SetActive(true); numObj.SetActive(true); gun1.gameObject.SetActive(true); gun2.gameObject.SetActive(true); babyTitle.gameObject.SetActive(true); nameLabel.transform.parent.gameObject.SetActive(true); backSp.gameObject.SetActive(true); CloseBtn.gameObject.SetActive(true); BabyData bdata = BabyData.GetData(babyId); // backSp.spriteName = "fazhen"; // getTypeSp.spriteName = "hdcw"; namesp.width = 630; typeNameLabel.text = LanguageManager.instance.GetValue("gxhuodechongwu"); nameLabel.text = bdata._Name; raceLable.text = LanguageManager.instance.GetValue(bdata._RaceType.ToString()); HeadIconLoader.Instance.LoadIcon(bdata._RaceIcon, raceTex); typeSp.spriteName = bdata._Tpye.ToString(); GameManager.Instance.GetActorClone((ENTITY_ID)bdata._AssetsID, (ENTITY_ID)0, EntityType.ET_Baby, AssetLoadCallBack, null, "3D"); }
void UpdeateItem() { BabyData bdatas = BabyData.GetData(_babyid); string [] items = bdatas._ReformItem.Split(';'); item01Label.text = ItemData.GetData(int.Parse(items [0])).name_; item02Label.text = ItemData.GetData(int.Parse(items [1])).name_; item03Label.text = ItemData.GetData(int.Parse(items [2])).name_; item1Num = BagSystem.instance.GetItemMaxNum(uint.Parse(items [0])); item2Num = BagSystem.instance.GetItemMaxNum(uint.Parse(items [1])); item3Num = BagSystem.instance.GetItemMaxNum(uint.Parse(items [2])); item01numLabel.text = item1Num + "/1"; item02numLabel.text = item2Num + "/1"; item03numLabel.text = item3Num + "/1"; numberLabel.text = GetMyBabyNumber(bdatas._Id) + "/1"; insetId = GetMyBabyInseid(bdatas._Id); if (insetId != 0 && item1Num != 0 && item2Num != 0 && item3Num != 0 && GetMyBabyNumber(bdatas._Id) > 0) { enterBtn.isEnabled = true; } else { enterBtn.isEnabled = false; } }
public void SetData(COM_SellItem sellItem) { sellItem_ = sellItem; ItemData idata = null; BabyData bData = null; if (sellItem.item_.itemId_ != 0) { idata = ItemData.GetData((int)sellItem.item_.itemId_); name_.text = idata.name_; ItemCellUI icell = UIManager.Instance.AddItemInstCellUI(icon_, sellItem_.item_); if (icell == null) { return; } icell.ItemCount = (int)sellItem.item_.stack_; icell.showTips = true; } else { bData = BabyData.GetData((int)sellItem.baby_.properties_[(int)PropertyType.PT_TableId]); name_.text = bData._Name; Baby baby = new Baby(); baby.SetBaby(sellItem.baby_); BabyCellUI cell = UIManager.Instance.AddBabyCellUI(icon_, baby); UIManager.SetButtonEventHandler(cell.gameObject, EnumButtonEvent.OnClick, OnClickIcon, 0, 0); } price_.text = sellItem_.sellPrice.ToString(); }
void RefreshGrowingUp(int uid) { if (GamePlayer.Instance.babies_list_.Count == 0) { ClearText(); } else { enterBtn.isEnabled = true; Uid = uid; Inst = GamePlayer.Instance.GetBabyInst(uid); BabyData bdata = BabyData.GetData(Inst.GetIprop(PropertyType.PT_TableId)); mofaLabel.text = "[-][666666]" + Inst.gear_[(int)BabyInitGear.BIG_Magic].ToString() + "/" + bdata._BIG_Magic; tiliLabel.text = "[-][666666]" + Inst.gear_[(int)BabyInitGear.BIG_Stama].ToString() + "/" + bdata._BIG_Stama; suduLabel.text = "[-][666666]" + Inst.gear_[(int)BabyInitGear.BIG_Speed].ToString() + "/" + bdata._BIG_Speed; qiangduLabel.text = "[-][666666]" + Inst.gear_[(int)BabyInitGear.BIG_Power].ToString() + "/" + bdata._BIG_Power; liLiangLabel.text = "[-][666666]" + Inst.gear_[(int)BabyInitGear.BIG_Strength].ToString() + "/" + bdata._BIG_Strength; type = bdata._Tpye; tiliSlider.value = (Inst.gear_[(int)BabyInitGear.BIG_Stama] * 1f) / (bdata._BIG_Stama * 1f); liliangSlider.value = (Inst.gear_[(int)BabyInitGear.BIG_Strength] * 1f) / (bdata._BIG_Strength * 1f); qiangduSlider.value = (Inst.gear_[(int)BabyInitGear.BIG_Power] * 1f) / (bdata._BIG_Power * 1f); suduSlider.value = (Inst.gear_[(int)BabyInitGear.BIG_Speed] * 1f) / (bdata._BIG_Speed * 1f); mofaSlider.value = (Inst.gear_[(int)BabyInitGear.BIG_Magic] * 1f) / (bdata._BIG_Magic * 1f); int dd = Inst.gear_[(int)BabyInitGear.BIG_Magic] + Inst.gear_[(int)BabyInitGear.BIG_Stama] + Inst.gear_[(int)BabyInitGear.BIG_Speed] + Inst.gear_[(int)BabyInitGear.BIG_Power] + Inst.gear_[(int)BabyInitGear.BIG_Strength]; dangshuLable.text = dd.ToString(); } }
void addBabyItem(List <Baby> babys) { for (int i = 0; i < babys.Count; i++) { if (babys[i] == null) { return; } GameObject go = GameObject.Instantiate(petItem) as GameObject; go.SetActive(true); go.transform.parent = grid.transform; //go.transform.position = Vector3.zero; go.transform.localScale = Vector3.one; go.name = babys[i].InstName; UIManager.SetButtonEventHandler(go.gameObject, EnumButtonEvent.OnClick, OnClickbabygo, babys[i].InstId, 0); UITexture[] tes = go.GetComponentsInChildren <UITexture>(); foreach (UITexture tex in tes) { if (tex.name.Equals("peticon")) { HeadIconLoader.Instance.LoadIcon(EntityAssetsData.GetData(babys[i].GetIprop(PropertyType.PT_AssetId)).assetsIocn_, tex); } if (tex.name.Equals("zhongzuicon")) { HeadIconLoader.Instance.LoadIcon(BabyData.GetData(babys[i].GetIprop(PropertyType.PT_TableId))._RaceIcon, tex); } } } grid.repositionNow = true; // for(int i =0;i<itemsobj.Count;i++) // { // itemsobj[i].SetActive(true); // } //grid.Reposition (); }
private void buttonClick(ButtonScript obj, object args, int param1, int param2) { babyName = obj.name; MainBabyListCell lCell = obj.GetComponent <MainBabyListCell>(); if (curCell != null) { curCell.backSp.spriteName = "zd_chongwukuang"; } int[] ids = { GamePlayer.Instance.babies_list_[param1].InstId, GamePlayer.Instance.babies_list_[param1].GetIprop(PropertyType.PT_AssetId) }; CrtSelectIdx = param1; curCell = lCell; lCell.backSp.spriteName = "zd_chongwukuangxuanz"; if (asssid != ids[1]) { if (asssid != 0 && babyObj != null) { DestroyBaby((ENTITY_ID)asssid, true, babyObj); } } if (MainbabyState.babyInfo != null) { MainbabyState.babyInfo(ids); } MainbabyProperty.idss = ids; int uId = ids[0]; int asseId = ids[1]; asssid = asseId; GameManager.Instance.GetActorClone((ENTITY_ID)asseId, (ENTITY_ID)0, EntityType.ET_Baby, AssetLoadCallBack, new ParamData(uId, asseId), "UI"); HeadIconLoader.Instance.LoadIcon(BabyData.GetData(GamePlayer.Instance.GetBabyInst(ids[0]).GetIprop(PropertyType.PT_TableId))._RaceIcon, modelRace_); raceLabel.text = LanguageManager.instance.GetValue(BabyData.GetData(GamePlayer.Instance.GetBabyInst(ids[0]).GetIprop(PropertyType.PT_TableId))._RaceType.ToString()); if (!_icons.Contains(BabyData.GetData(GamePlayer.Instance.GetBabyInst(ids[0]).GetIprop(PropertyType.PT_TableId))._RaceIcon)) { _icons.Add(BabyData.GetData(GamePlayer.Instance.GetBabyInst(ids[0]).GetIprop(PropertyType.PT_TableId))._RaceIcon); } if (MainbabyProperty.BabyProperty != null) { MainbabyProperty.BabyProperty(uId); } if (MainbabyReductionUI.RefreshGrowingUpOk != null) { MainbabyReductionUI.RefreshGrowingUpOk(ids[0]); } if (Mainbabystrengthen.RefreshstrengthenOk != null) { Mainbabystrengthen.RefreshstrengthenOk(ids[0]); } if (MainbabyListUI.UpdateBabyMarkOnOk != null) { MainbabyListUI.UpdateBabyMarkOnOk(uId); } }
void SetBabyData(Baby ba) { BabyData bdata = BabyData.GetData(ba.GetIprop(PropertyType.PT_TableId)); gongjiLable.text = ba.GetIprop(PropertyType.PT_Attack).ToString(); fangyuLable.text = ba.GetIprop(PropertyType.PT_Defense).ToString(); minjieLable.text = ba.GetIprop(PropertyType.PT_Agile).ToString(); jingshenLable.text = ba.GetIprop(PropertyType.PT_Spirit).ToString(); huifuLable.text = ba.GetIprop(PropertyType.PT_Reply).ToString(); bishaLable.text = ba.GetIprop(PropertyType.PT_Crit).ToString(); mingzhongLable.text = ba.GetIprop(PropertyType.PT_Hit).ToString(); fanjiLable.text = ba.GetIprop(PropertyType.PT_counterpunch).ToString(); shanduoLable.text = ba.GetIprop(PropertyType.PT_Dodge).ToString(); jinengLable.text = bdata._SkillNum.ToString(); babysuo.SetActive(ba.GetInst().isLock_); instId = ba.InstId; HeadIconLoader.Instance.LoadIcon(EntityAssetsData.GetData(BabyData.GetData(ba.GetIprop(PropertyType.PT_TableId))._AssetsID).assetsIocn_, babyIcon); //iconkuang.spriteName = BabyData.GetPetQuality(bdata._PetQuality); int Magic = bdata._BIG_Magic - ba.gear_[(int)BabyInitGear.BIG_Magic]; int Stama = bdata._BIG_Stama - ba.gear_[(int)BabyInitGear.BIG_Stama]; int Speed = bdata._BIG_Speed - ba.gear_[(int)BabyInitGear.BIG_Speed]; int Power = bdata._BIG_Power - ba.gear_[(int)BabyInitGear.BIG_Power]; int Strength = bdata._BIG_Strength - ba.gear_[(int)BabyInitGear.BIG_Strength]; int num = Magic + Stama + Speed + Power + Strength; pinjiSp.spriteName = BabyData.GetBabyLeveSp(num); }
private void buttonClick(ButtonScript obj, object args, int param1, int param2) { BabyData bab = BabyData.GetData(param1); string ReformItem = bab._ReformItem; // if(ReformItem == "") // { // // PopText.Instance.Show(LanguageManager.instance.GetValue("babygaizao1")); // // }else // if(inst.GetIprop(PropertyType.PT_Level)>1) // { // // PopText.Instance.Show(LanguageManager.instance.GetValue("babygaizao2")); // }else // { // if(MainbabyReformUI.ShowbabyInfoOk != null) // { // MainbabyReformUI.ShowbabyInfoOk(inst,ReformItem,bab._ReformMonster); // } RefreshBabyData(bab, ReformItem, bab._ReformMonster); //gameObject.SetActive(false); // } }
// Use this for initialization void Start() { DaliyActivityData dad = DaliyActivityData.GetData(ActivityType.ACT_Pet); ActivitySystem.Instance.petTempTimes_ = dad.maxCount_; SkillItem.SetActive(false); if (ActivitySystem.Instance.petTempTimes_ - ActivitySystem.Instance.GetCount(ActivityType.ACT_Pet) <= 0) { catchBtn_.isEnabled = false; } else { catchBtn_.isEnabled = true; } crtSelectIdx_ = -1; diffPanel_.gameObject.SetActive(false); if (itemPool_ == null) { itemPool_ = new List <GameObject>(); } UIManager.SetButtonEventHandler(catchBtn_.gameObject, EnumButtonEvent.OnClick, OnCatch, 0, 0); UIManager.SetButtonEventHandler(closeBtn_.gameObject, EnumButtonEvent.OnClick, OnClose, 0, 0); pdata = PetActivityData.GetData(1); BabyData baby = BabyData.GetData(pdata.monsterID_); if (baby != null) { nameLable.text = baby._Name; decLable.text = baby._Desc; GameManager.Instance.GetActorClone((ENTITY_ID)baby._AssetsID, (ENTITY_ID)0, EntityType.ET_Baby, (GameObject go, ParamData pData) => { if (destroyed_) { Destroy(go); return; } go.transform.parent = mopos; go.transform.localScale = Vector3.one * EntityAssetsData.GetData(pData.iParam).zoom_ * 0.7f; go.transform.localPosition = new Vector3(0f, 0f, -90f); go.transform.localScale = new Vector3(550, 550, 550); go.transform.Rotate(Vector3.up, 180f); }, new ParamData(baby._AssetsID), "UI"); for (int i = 0; i < pdata.skillIDs_.Length; i++) { GameObject go = GameObject.Instantiate(SkillItem) as GameObject; go.SetActive(true); go.transform.parent = skillGrid.transform; go.transform.localScale = Vector3.one; UITexture tex = go.GetComponentInChildren <UITexture>(); HeadIconLoader.Instance.LoadIcon(SkillData.GetMinxiLevelData(int.Parse(pdata.skillIDs_[i]))._ResIconName, tex); Listener = UIEventListener.Get(go); Listener.parameter = pdata.skillIDs_[i]; Listener.onPress = buttonPress; } } UpdateUI(); }
void Refresh(int uid) { if (GamePlayer.Instance.babies_list_.Count == 0) { ClearText(); } else { float [] addPoints = new float[5]; Inst = GamePlayer.Instance.GetBabyInst(uid); if (Inst == null) { return; } BabyData bdata = BabyData.GetData(Inst.GetIprop(PropertyType.PT_TableId)); HeadIconLoader.Instance.LoadIcon(EntityAssetsData.GetData(bdata._AssetsID).assetsIocn_, babyIcon); HeadIconLoader.Instance.LoadIcon(bdata._RaceIcon, raceIcon); babyNameLabel.text = Inst.InstName; if (Inst.intensifyLevel_ == 10) { enterBtn.isEnabled = false; newLevel.gameObject.SetActive(false); raSp.gameObject.SetActive(false); raaSp.gameObject.SetActive(false); oldLevel.text = LanguageManager.instance.GetValue("babyAlreadyOnTop"); PetIntensiveData petData = PetIntensiveData.GetData((int)Inst.intensifyLevel_); oldChengzhang.text = petData.grow_.ToString(); chneglv.text = petData.probability_ + "%"; newChengzhang.text = ""; } else { newLevel.gameObject.SetActive(true); raSp.gameObject.SetActive(true); enterBtn.isEnabled = true; raaSp.gameObject.SetActive(true); oldLevel.text = Inst.intensifyLevel_.ToString(); PetIntensiveData petData = PetIntensiveData.GetData((int)Inst.intensifyLevel_); oldChengzhang.text = petData.grow_.ToString(); PetIntensiveData petNData = PetIntensiveData.GetData((int)Inst.intensifyLevel_ + 1); newChengzhang.text = petNData.grow_.ToString(); newLevel.text = (Inst.intensifyLevel_ + 1).ToString(); chneglv.text = petNData.probability_ + "%"; if (BagSystem.instance.GetItemMaxNum((uint)itemID()) >= itemCount()) { enterBtn.isEnabled = true; } else { enterBtn.isEnabled = false; } } updateUI(null); } }
public override void Destroyobj() { UIManager.RemoveButtonEventHandler(catchBtn_.gameObject, EnumButtonEvent.OnClick); UIManager.RemoveButtonEventHandler(closeBtn_.gameObject, EnumButtonEvent.OnClick); BabyData baby = BabyData.GetData(pdata.monsterID_); if (baby != null) { PlayerAsseMgr.DeleteAsset((ENTITY_ID)baby._AssetsID, false); } }
public static bool IsCaptureBaby(int babyId) { for (int i = 0; i < GamePlayer.Instance.babies_list_.Count; i++) { if (babyId == BabyData.GetData(GamePlayer.Instance.babies_list_[i].GetIprop(PropertyType.PT_TableId))._Id) { return(true); } } return(false); }
void Start() { hasDestroy_ = false; InitUIText(); Bdata = BabyData.GetData(TuJianUI.babyId); UIManager.SetButtonEventHandler(skillClosebtn.gameObject, EnumButtonEvent.OnClick, OnClickskillClosebtn, 0, 0); UIManager.SetButtonEventHandler(goumaiBtn.gameObject, EnumButtonEvent.OnClick, OnClickgoumai, 0, 0); UIManager.SetButtonEventHandler(lookSkillbtn.gameObject, EnumButtonEvent.OnClick, OnClicklookSkill, 0, 0); UIManager.SetButtonEventHandler(closeBtn.gameObject, EnumButtonEvent.OnClick, OnClickclose, 0, 0); UIEventListener.Get(leftBtn.gameObject).onPress = leftBtnPress; UIEventListener.Get(rightBtn.gameObject).onPress = rightBtnPress; }
void OnEnable() { Uid = MainbabyProperty.idss[0]; Inst = GamePlayer.Instance.GetBabyInst(Uid); BabyData bdata = BabyData.GetData(Inst.GetIprop(PropertyType.PT_TableId)); mofaLabel.text = "[-][666666]" + Inst.gear_[(int)BabyInitGear.BIG_Magic].ToString() + "[-][33FF66]" + " -" + (bdata._BIG_Magic - Inst.gear_[(int)BabyInitGear.BIG_Magic]); tiLiLabel.text = "[-][666666]" + Inst.gear_[(int)BabyInitGear.BIG_Stama].ToString() + "[-][33FF66]" + " -" + (bdata._BIG_Stama - Inst.gear_[(int)BabyInitGear.BIG_Stama]); SuduLabel.text = "[-][666666]" + Inst.gear_[(int)BabyInitGear.BIG_Speed].ToString() + "[-][33FF66]" + " -" + (bdata._BIG_Speed - Inst.gear_[(int)BabyInitGear.BIG_Speed]); QiangduLabel.text = "[-][666666]" + Inst.gear_[(int)BabyInitGear.BIG_Power].ToString() + "[-][33FF66]" + " -" + (bdata._BIG_Power - Inst.gear_[(int)BabyInitGear.BIG_Power]); LiliangLabel.text = "[-][666666]" + Inst.gear_[(int)BabyInitGear.BIG_Strength].ToString() + "[-][33FF66]" + " -" + (bdata._BIG_Strength - Inst.gear_[(int)BabyInitGear.BIG_Strength]); }
int GetMyBabyInseid(int inId) { for (int i = 0; i < GamePlayer.Instance.babies_list_.Count; i++) { BabyData ba = BabyData.GetData(GamePlayer.Instance.babies_list_[i].GetIprop(PropertyType.PT_TableId)); if (inId == ba._Id) { return(GamePlayer.Instance.babies_list_[i].InstId); } } return(0); }
void ShowBabyProperty() { if (Inst.GetIprop(PropertyType.PT_Free) == 0) { tuijian.gameObject.SetActive(false); } else { tuijian.gameObject.SetActive(true); } Shengyu.text = Inst.GetIprop(PropertyType.PT_Free).ToString(); tili.text = Inst.GetIprop(PropertyType.PT_Stama).ToString(); liliang.text = Inst.GetIprop(PropertyType.PT_Strength).ToString(); Qiangdu.text = Inst.GetIprop(PropertyType.PT_Power).ToString(); sudu.text = Inst.GetIprop(PropertyType.PT_Speed).ToString(); mofa.text = Inst.GetIprop(PropertyType.PT_Magic).ToString(); accatkLabel.text = Inst.GetIprop(PropertyType.PT_Attack).ToString(); defensekLabel.text = Inst.GetIprop(PropertyType.PT_Defense).ToString(); agilitykLabel.text = Inst.GetIprop(PropertyType.PT_Agile).ToString(); spiritLabel.text = Inst.GetIprop(PropertyType.PT_Spirit).ToString(); replyLabel.text = Inst.GetIprop(PropertyType.PT_Reply).ToString(); slayLabel.text = Inst.GetIprop(PropertyType.PT_Sex).ToString(); hitLabel.text = Inst.GetIprop(PropertyType.PT_Hit).ToString(); counterattackLabel.text = Inst.GetIprop(PropertyType.PT_counterpunch).ToString(); dodgingLabel.text = Inst.GetIprop(PropertyType.PT_Dodge).ToString(); lethargyLabel.text = Inst.GetIprop(PropertyType.PT_NoSleep).ToString(); KangduLabel.text = Inst.GetIprop(PropertyType.PT_NoPoison).ToString(); AntidrunkLabel.text = Inst.GetIprop(PropertyType.PT_NoDrunk).ToString(); AntichaosLabel.text = Inst.GetIprop(PropertyType.PT_NoChaos).ToString(); AntiamnesticLabel.text = Inst.GetIprop(PropertyType.PT_NoForget).ToString(); AntiPetrochemicalLabel.text = Inst.GetIprop(PropertyType.PT_NoPetrifaction).ToString(); if (Inst.GetIprop(PropertyType.PT_Free) == 0) { tuijian.gameObject.SetActive(false); } else { tuijian.gameObject.SetActive(true); } for (int i = 0; i < Attributes.Count; i++) { if (i == BabyData.StrongestAttribute(Inst.GetIprop(PropertyType.PT_TableId))) { tuijian.transform.position = new Vector3(tuijian.transform.position.x, Attributes[i].transform.position.y, tuijian.transform.position.z); } } }
public void AddItems(List <Baby> Entitylist) { if (Entitylist == null) { return; } for (int i = 0; i < Entitylist.Count; i++) { GameObject o = GameObject.Instantiate(item) as GameObject; o.SetActive(true); o.name = Entitylist[i].InstName; o.transform.parent = grid.transform; o.transform.localPosition = Vector3.zero; MainBabyListCell mbCell = o.GetComponent <MainBabyListCell>(); mbCell.BabyMainData = Entitylist[i]; listCells.Add(mbCell); o.transform.localScale = new Vector3(1, 1, 1); UIManager.SetButtonEventHandler(o, EnumButtonEvent.OnClick, buttonClick, i, 0); //grid.repositionNow = true; itemsList.Add(o); } GlobalInstanceFunction.Instance.Invoke(() => { grid.Reposition(); }, 1); if (itemsList != null && itemsList.Count > 0) { int[] ids = { Entitylist[0].InstId, Entitylist[0].GetIprop(PropertyType.PT_AssetId) }; GameManager.Instance.GetActorClone((ENTITY_ID)Entitylist[0].Properties[(int)PropertyType.PT_AssetId], (ENTITY_ID)0, Entitylist[0].type_, AssetLoadCallBack, new ParamData(Entitylist[0].InstId, Entitylist[0].GetIprop(PropertyType.PT_AssetId)), "UI"); MainbabyProperty.idss = ids; //modelName_.text = GamePlayer.Instance.GetBabyInst(Entitylist[0].InstId).InstName; //modelRace_.spriteName = BabyData.GetData(GamePlayer.Instance.GetBabyInst(Entitylist[0].InstId).GetIprop(PropertyType.PT_TableId)).RaceIcon_; HeadIconLoader.Instance.LoadIcon(BabyData.GetData(GamePlayer.Instance.GetBabyInst(Entitylist[0].InstId).GetIprop(PropertyType.PT_TableId))._RaceIcon, modelRace_); if (!_icons.Contains(BabyData.GetData(GamePlayer.Instance.GetBabyInst(Entitylist[0].InstId).GetIprop(PropertyType.PT_TableId))._RaceIcon)) { _icons.Add(BabyData.GetData(GamePlayer.Instance.GetBabyInst(Entitylist[0].InstId).GetIprop(PropertyType.PT_TableId))._RaceIcon); } raceLabel.text = LanguageManager.instance.GetValue(BabyData.GetData(GamePlayer.Instance.GetBabyInst(Entitylist[0].InstId).GetIprop(PropertyType.PT_TableId))._RaceType.ToString()); if (MainbabyState.babyInfo != null) { MainbabyState.babyInfo(ids); } } NewBabyMakeOn(); }
int GetMyBabyNumber(int inId) { int number = 0; for (int i = 0; i < GamePlayer.Instance.babies_list_.Count; i++) { BabyData ba = BabyData.GetData(GamePlayer.Instance.babies_list_[i].GetIprop(PropertyType.PT_TableId)); if (inId == ba._Id) { number++; } } return(number); }
void MainbabyReform() { List <BabyData> babys = new List <BabyData> (); foreach (KeyValuePair <int, BabyData> Pair in BabyData.GetData()) { if (!Pair.Value._ReformItem.Equals("")) { babys.Add(Pair.Value); } } addItem(babys); }
void addItem(List <Baby> babys) { Refresh(); for (int i = 0; i < babys.Count; i++) { GameObject o = GameObject.Instantiate(item) as GameObject; o.SetActive(true); o.name = o.name + i; o.transform.parent = grid.transform; MainBabyListCell mbCell = o.GetComponent <MainBabyListCell>(); Baby inst = GamePlayer.Instance.GetBabyInst(babys[i].InstId); mbCell.BabyMainData = babys[i]; BabyData bab = BabyData.GetData(inst.GetIprop(PropertyType.PT_TableId)); string ReformItem = bab._ReformItem; // if(MainbabyReformUI.isMainbabyReformUI) // { // if(babys[i].isForBattle_) // { // mbCell.chuzhanButton.gameObject.SetActive(true); // mbCell.chuzhanButton.isEnabled = false; // mbCell.daimingButton.gameObject.SetActive(false); // }else // { // mbCell.chuzhanButton.gameObject.SetActive(false); // mbCell.daimingButton.gameObject.SetActive(true); // mbCell.daimingButton.isEnabled = false; // } // } // if(ReformItem == "") // { // mbCell.ban.gameObject.SetActive(true); // // // }else // if(inst.GetIprop(PropertyType.PT_Level)>1) // { // mbCell.ban.gameObject.SetActive(true); // // }else // { // mbCell.ban.gameObject.SetActive(false); // } o.transform.localScale = new Vector3(1, 1, 1); UIManager.SetButtonEventHandler(o, EnumButtonEvent.OnClick, buttonClick, babys[i].InstId, babys[i].GetIprop(PropertyType.PT_AssetId)); grid.repositionNow = true; } }
void UpdateHead() { if (GamePlayer.Instance.babies_list_[MainbabyListUI.CrtSelectIdx] == null) { ClearHead(); return; } ClearHead(); BabyData bd = BabyData.GetData(GamePlayer.Instance.babies_list_[MainbabyListUI.CrtSelectIdx].GetIprop(PropertyType.PT_TableId)); EntityAssetsData ead = EntityAssetsData.GetData(bd._AssetsID); iconKuang.spriteName = BabyData.GetPetQuality(bd._PetQuality); iconType.spriteName = bd._Tpye.ToString(); crtHeadIcon = ead.assetsIocn_; HeadIconLoader.Instance.LoadIcon(crtHeadIcon, icon); }
public void SetData(Baby inst) { inst_ = inst; name_.text = inst_.InstName; realName_ = BabyData.GetData((int)inst.GetEntity().properties_[(int)PropertyType.PT_TableId])._Name; level_.text = (inst_.GetIprop(PropertyType.PT_Level)).ToString(); float tax = 0f; GlobalValue.Get(Constant.C_MallTax, out tax); tax_.text = string.Format("[ff0000]{0}[-]", ((int)(tax * 100f)).ToString()); SkillData skill = null; UITexture tex = null; GameObject texGo = null; for (int i = 0; i < inst_.SkillInsts.Count; ++i) { skill = SkillData.GetData((int)inst_.SkillInsts[i].skillID_, (int)inst_.SkillInsts[i].skillLevel_); if (skill._Name.Equals(LanguageManager.instance.GetValue("playerPro_FightBack")) || skill._Name.Equals(LanguageManager.instance.GetValue("playerPro_Dodge"))) { continue; } tex = skills_[i].GetComponentInChildren <UITexture>(); if (tex == null) { texGo = new GameObject(); texGo.layer = LayerMask.NameToLayer("UI"); tex = texGo.AddComponent <UITexture>(); tex.transform.parent = skills_[i].transform; texGo.transform.localPosition = Vector3.zero; texGo.transform.localScale = Vector3.one; tex.depth = skills_[i].GetComponent <UISprite>().depth + 1; } HeadIconLoader.Instance.LoadIcon(skill._ResIconName, tex); } BabyCellUI cell = UIManager.Instance.AddBabyCellUI(icon_, inst); UIManager.SetButtonEventHandler(cell.gameObject, EnumButtonEvent.OnClick, OnClickIcon, 0, 0); UIManager.SetButtonEventHandler(sellBtn_.gameObject, EnumButtonEvent.OnClick, OnSell, 0, 0); UIManager.SetButtonEventHandler(cancelBtn_.gameObject, EnumButtonEvent.OnClick, (ButtonScript obj, object args, int param1, int param2) => { gameObject.SetActive(false); }, 0, 0); gameObject.SetActive(true); }
public void SetData(string info) { string[] infos = info.Split('|'); if (bool.Parse(infos[1])) { ItemData data = ItemData.GetData(int.Parse(infos[0])); name_.text = data.name_; UIManager.Instance.AddItemCellUI(icon_, (uint)data.id_); } else { BabyData baby = BabyData.GetData(int.Parse(infos[0])); name_.text = baby._Name; UIManager.Instance.AddBabyCellUI(icon_, baby); } gameObject.SetActive(true); }
void OnEnable() { if (GamePlayer.Instance.babies_list_.Count == 0) { ClearText(); } else { Uid = MainbabyProperty.idss[0]; Inst = GamePlayer.Instance.GetBabyInst(Uid); BabyData bdata = BabyData.GetData(Inst.GetIprop(PropertyType.PT_TableId)); type = bdata._Tpye; int Magic = bdata._BIG_Magic - Inst.gear_[(int)BabyInitGear.BIG_Magic]; int Stama = bdata._BIG_Stama - Inst.gear_[(int)BabyInitGear.BIG_Stama]; int Speed = bdata._BIG_Speed - Inst.gear_[(int)BabyInitGear.BIG_Speed]; int Power = bdata._BIG_Power - Inst.gear_[(int)BabyInitGear.BIG_Power]; int Strength = bdata._BIG_Strength - Inst.gear_[(int)BabyInitGear.BIG_Strength]; int num = Magic + Stama + Speed + Power + Strength; onesp.spriteName = BabyData.GetBabyLeveSp(num) + "_big"; oldBdata = bdata; mofaLabel.text = "[-][666666]" + Inst.gear_[(int)BabyInitGear.BIG_Magic].ToString() + "/" + bdata._BIG_Magic; tiliLabel.text = "[-][666666]" + Inst.gear_[(int)BabyInitGear.BIG_Stama].ToString() + "/" + bdata._BIG_Stama; suduLabel.text = "[-][666666]" + Inst.gear_[(int)BabyInitGear.BIG_Speed].ToString() + "/" + bdata._BIG_Speed; qiangduLabel.text = "[-][666666]" + Inst.gear_[(int)BabyInitGear.BIG_Power].ToString() + "/" + bdata._BIG_Power; liLiangLabel.text = "[-][666666]" + Inst.gear_[(int)BabyInitGear.BIG_Strength].ToString() + "/" + bdata._BIG_Strength; tiliSlider.value = (Inst.gear_[(int)BabyInitGear.BIG_Stama] * 1f) / (bdata._BIG_Stama * 1f); liliangSlider.value = (Inst.gear_[(int)BabyInitGear.BIG_Strength] * 1f) / (bdata._BIG_Strength * 1f); qiangduSlider.value = (Inst.gear_[(int)BabyInitGear.BIG_Power] * 1f) / (bdata._BIG_Power * 1f); suduSlider.value = (Inst.gear_[(int)BabyInitGear.BIG_Speed] * 1f) / (bdata._BIG_Speed * 1f); mofaSlider.value = (Inst.gear_[(int)BabyInitGear.BIG_Magic] * 1f) / (bdata._BIG_Magic * 1f); int dd = Inst.gear_[(int)BabyInitGear.BIG_Magic] + Inst.gear_[(int)BabyInitGear.BIG_Stama] + Inst.gear_[(int)BabyInitGear.BIG_Speed] + Inst.gear_[(int)BabyInitGear.BIG_Power] + Inst.gear_[(int)BabyInitGear.BIG_Strength]; dangshuLable.text = dd.ToString(); } if (GlobalValue.isBattleScene(StageMgr.Scene_name)) { enterBtn.gameObject.SetActive(false); } }
void InitbabySkillData() { BabyData bdata = BabyData.GetData(baby.GetIprop(PropertyType.PT_TableId)); for (int i = 0; i < baby.SkillInsts.Count; i++) { SkillData sdata = SkillData.GetMinxiLevelData((int)baby.SkillInsts[i].skillID_); if (sdata._Name.Equals(LanguageManager.instance.GetValue("playerPro_FightBack"))) { continue; } if (sdata._Name.Equals(LanguageManager.instance.GetValue("playerPro_Dodge"))) { continue; } skillDatas.Add(sdata); } AddSkillItem(bdata); }
public void SetData(COM_SelledItem item) { string fmt = "MM月dd日HH:mm"; Define.FormatUnixTimestamp(ref fmt, item.selledTime_); date_.text = fmt; string name = ""; if (item.itemId_ != 0) { name = ItemData.GetData(item.itemId_).name_; name_.text = name + string.Format("({0})", item.itemStack_); } else { name = BabyData.GetData(item.babyId_)._Name; name_.text = name; } gainDiamond_.text = item.price_.ToString(); tax_.text = item.tax_.ToString(); }
void AddSkillItem(BabyData bdata) { for (int i = 0; i < skillDatas.Count; ++i) { if (i > bdata._SkillNum) { break; ///错误 } GameObject clone = GameObject.Instantiate(skill_item) as GameObject; clone.SetActive(true); clone.transform.parent = grid.transform; clone.transform.position = Vector3.zero; clone.transform.localScale = Vector3.one; UITexture te = clone.GetComponentInChildren <UITexture>(); if (te != null) { HeadIconLoader.Instance.LoadIcon(skillDatas[i]._ResIconName, te); } } GlobalInstanceFunction.Instance.Invoke(() => { grid.Reposition(); }, 1); }
bool IsbabyS() { if (Inst == null) { return(false); } BabyData bdata = BabyData.GetData(Inst.GetIprop(PropertyType.PT_TableId)); int Magic = bdata._BIG_Magic - Inst.gear_[(int)BabyInitGear.BIG_Magic]; int Stama = bdata._BIG_Stama - Inst.gear_[(int)BabyInitGear.BIG_Stama]; int Speed = bdata._BIG_Speed - Inst.gear_[(int)BabyInitGear.BIG_Speed]; int Power = bdata._BIG_Power - Inst.gear_[(int)BabyInitGear.BIG_Power]; int Strength = bdata._BIG_Strength - Inst.gear_[(int)BabyInitGear.BIG_Strength]; int num = Magic + Stama + Speed + Power + Strength; string l = BabyData.GetBabyLeveSp(num); if (l.Equals("S")) { return(true); } return(false); }
public void SetBabyInfo() { BattleActor battbaby = Battle.Instance.SelfActorBattleBaby; if (battbaby == null) { babyHpLable.text = ""; babyMpLable.text = ""; babyhpSlider.value = 0; babympSlider.value = 0; babyNameLable.text = ""; // babyRaceT.mainTexture = null; babyIconT.mainTexture = null; typeBabySp.gameObject.SetActive(false); mpObj.SetActive(false); hpObj.SetActive(false); levelObj.SetActive(false); } else { //HeadIconLoader.Instance.LoadIcon (BabyData.GetData(GamePlayer.Instance.BattleBaby.GetIprop(PropertyType.PT_TableId))._RaceIcon, babyRaceT); mpObj.SetActive(true); hpObj.SetActive(true); levelObj.SetActive(true); HeadIconLoader.Instance.LoadIcon(EntityAssetsData.GetData(BabyData.GetData(GamePlayer.Instance.BattleBaby.GetIprop(PropertyType.PT_TableId))._AssetsID).assetsIocn_, babyIconT); babyNameLable.text = GamePlayer.Instance.BattleBaby.GetIprop(PropertyType.PT_Level).ToString(); BabyData bdata = BabyData.GetData(GamePlayer.Instance.BattleBaby.GetIprop(PropertyType.PT_TableId)); typeBabySp.gameObject.SetActive(true); typeBabySp.spriteName = bdata._Tpye.ToString(); int crtHp = battbaby.battlePlayer.hpCrt_; int crtMp = battbaby.battlePlayer.mpCrt_; int maxHp = battbaby.battlePlayer.hpMax_; int maxMp = battbaby.battlePlayer.mpMax_; babyHpLable.text = crtHp + "/" + maxHp; babyMpLable.text = crtMp + "/" + maxMp; babyhpSlider.value = crtHp * 1f / maxHp * 1f; babympSlider.value = crtMp * 1f / maxMp * 1f; } }
string GetBPinzhi(BabyData bdata) { if (bdata._PetQuality == PetQuality.PE_Blue) { return("62c6ff"); } else if (bdata._PetQuality == PetQuality.PE_Golden) { return("ffea5e"); } else if (bdata._PetQuality == PetQuality.PE_Green) { return("5af936"); } else if (bdata._PetQuality == PetQuality.PE_Orange) { return("ff6600"); } else if (bdata._PetQuality == PetQuality.PE_Pink) { return("ff618a"); } else if (bdata._PetQuality == PetQuality.PE_Purple) { return("d05eff"); } else if (bdata._PetQuality == PetQuality.PE_White) { return("ffffff"); } return("00ff00"); }