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) { Baby b = null; b = GamePlayer.Instance.GetBabyInst(param1); if (b != null) { if (BankSystem.instance.IsBabyStorageFull()) { PopText.Instance.Show(LanguageManager.instance.GetValue("cankuman")); return; } if (b.isForBattle_) { PopText.Instance.Show(LanguageManager.instance.GetValue("chuzhan")); return; } if (b.GetInst().isShow_) { PopText.Instance.Show(LanguageManager.instance.GetValue("showbaby")); return; } StorageBabyCell bCell = obj.GetComponentInParent <StorageBabyCell> (); sDouble = false; StartCoroutine(DelayOnesortClick(bCell)); } }
void SetBabyInfo(Baby inst) { skillDatas.Clear(); if (inst == null) { return; } nameLabel.text = inst.InstName; loyaltyLabel.text = inst.GetIprop(PropertyType.PT_Glamour).ToString(); levelLabel.text = inst.GetIprop(PropertyType.PT_Level).ToString(); diSlider.value = BabyData.GetData(inst.GetIprop(PropertyType.PT_TableId))._Ground / 10f; fengSlider.value = BabyData.GetData(inst.GetIprop(PropertyType.PT_TableId))._Wind / 10f; shuiSlider.value = BabyData.GetData(inst.GetIprop(PropertyType.PT_TableId))._Water / 10f; huoSlider.value = BabyData.GetData(inst.GetIprop(PropertyType.PT_TableId))._Fire / 10f; leixngSp.spriteName = BabyData.GetData(inst.GetIprop(PropertyType.PT_TableId))._Tpye.ToString(); zhandouliLabel.text = inst.GetIprop(PropertyType.PT_FightingForce).ToString(); for (int i = 0; i < skillIcons.Length; ++i) { //初始化 Listener = UIEventListener.Get(skillIcons[i].GetComponent <UIButton>().gameObject); Listener.onPress = null; UIManager.RemoveButtonEventHandler(skillIcons[i].gameObject, EnumButtonEvent.OnClick); Transform ssp = skillIcons[i].transform.FindChild("suo000"); ssp.gameObject.SetActive(false); ssp = skillIcons[i].transform.FindChild("skillicon"); ssp.gameObject.SetActive(false); } BabyData bdata = BabyData.GetData(inst.GetIprop(PropertyType.PT_TableId)); for (int i = 0; i < inst.SkillInsts.Count; i++) { SkillData sdata = SkillData.GetMinxiLevelData((int)inst.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); } for (int i = 0; i < skillDatas.Count; ++i) { if (i > skillIcons.Length) { break; /// rongcuo } if (i > bdata._SkillNum) { break; ///错误 } skillIcons[i].gameObject.SetActive(true); Transform ssp = skillIcons[i].transform.FindChild("suo000"); ssp.gameObject.SetActive(false); ssp = skillIcons[i].transform.FindChild("skillicon"); ssp.gameObject.SetActive(true); UITexture sp = skillIcons[i].GetComponentInChildren <UITexture>(); iconNames_.Add(skillDatas[i]._ResIconName); HeadIconLoader.Instance.LoadIcon(skillDatas[i]._ResIconName, sp); Listener = UIEventListener.Get(skillIcons[i].GetComponent <UIButton>().gameObject); Listener.parameter = skillDatas[i]._Id; Listener.onPress = buttonPress; } for (int i = 0; i < skillIcons.Length; i++) { if (i < skillDatas.Count) { Transform ps = skillIcons [i].transform.FindChild("Ps"); ps.gameObject.SetActive(false); } if (i < bdata._SkillNum && i >= skillDatas.Count) { Transform ps = skillIcons [i].transform.FindChild("Ps"); ps.gameObject.SetActive(true); skillIcons [i].gameObject.SetActive(true); UIManager.SetButtonEventHandler(skillIcons [i].gameObject, EnumButtonEvent.OnClick, OnClickSkillNpc, 0, 0); } if (i >= bdata._SkillNum) { skillIcons [i].gameObject.SetActive(false); } } int Protect = 0; oldLevel = 0; GlobalValue.Get(Constant.C_AucGoodProtect, out Protect); //FormatTimeHasDay ((int)inst.GetInst ().lastSellTime_); //int day = (Protect - GlobalInstanceFunction.Instance.DayPass ((int)inst.GetInst ().lastSellTime_)); dongjieSp.text = FormatTimeHasDay((int)inst.GetInst().lastSellTime_); //LanguageManager.instance.GetValue ("dongjie").Replace ("{n}",day.ToString()); if (inst.GetInst().lastSellTime_ <= 0) { dongjieObj.SetActive(false); } else { dongjieObj.SetActive(true); } curExp = (long)inst.Properties[(int)PropertyType.PT_Exp]; maxExp = ExpData.GetBabyMaxExp(inst.GetIprop(PropertyType.PT_Level)); if (inst.GetIprop(PropertyType.PT_Level) > 1) { oldLevel = (inst.GetIprop(PropertyType.PT_Level) - 1); } else { oldExp = 0; } oldExp = ExpData.GetBabyMaxExp(oldLevel); long s = curExp - oldExp; if (s < 0) { s = 0; } Expl.value = (s * 1f) / ((maxExp - oldExp) * 1f); exptextLbel.text = s + "/" + (maxExp - oldExp); // if(inst.GetIprop(PropertyType.PT_Level)>1) // { // oldLevel = (inst.GetIprop(PropertyType.PT_Level)-1); // }else // { // oldexp = 0; // } // oldexp = ExpData.GetBabyMaxExp(oldLevel); // // int fExp = 0; // int bExp = 0; // if(inst.GetIprop(PropertyType.PT_Level)>1) // { // fExp = (curExp-oldexp); // bExp = (maxExp-oldexp); // exptextLbel.text = fExp + "/" + bExp; // } // else // { // fExp = curExp; // bExp = maxExp; // exptextLbel.text = curExp + "/" + maxExp; // } // Expl.value = (float)fExp / (float)bExp; // Expl.value = (curExp * 1f) / (maxExp * 1f); //Debug.Log ("curexp ==" + curExp + " maxExp==" + maxExp + " oldExp==" + oldexp + " (maxExp-oldExp)" + (maxExp - oldexp)); }
public void UpDateBabyInfo(int id) { if (GamePlayer.Instance.babies_list_.Count == 0) { ClearText(0); } else { Baby inst = GamePlayer.Instance.GetBabyInst(id); if (inst == null) { return; } binst = inst; SetBabyInfo(inst); if (binst.isForBattle_) { chuzhanBtn.gameObject.SetActive(false); daimingBtn.gameObject.SetActive(true); } else { chuzhanBtn.gameObject.SetActive(true); daimingBtn.gameObject.SetActive(false); } if (binst.GetInst().isShow_) { shouhuiBtn.gameObject.SetActive(true); zhanshiBtn.gameObject.SetActive(false); } else { shouhuiBtn.gameObject.SetActive(false); zhanshiBtn.gameObject.SetActive(true); } if (binst.GetInst().isLock_) { jiesuoBtn.gameObject.SetActive(true); suodingBtn.gameObject.SetActive(false); } else { jiesuoBtn.gameObject.SetActive(false); suodingBtn.gameObject.SetActive(true); } } if (GlobalValue.isBattleScene(StageMgr.Scene_name)) { kjBtn.gameObject.SetActive(false); chuzhanBtn.gameObject.SetActive(false); daimingBtn.gameObject.SetActive(false); babyBank.gameObject.SetActive(false); babyDel.gameObject.SetActive(false); zhanshiBtn.gameObject.SetActive(false); shouhuiBtn.gameObject.SetActive(false); changeNameBtn.gameObject.SetActive(false); suodingBtn.gameObject.SetActive(false); jiesuoBtn.gameObject.SetActive(false); } }
void OnClickIcon(ButtonScript obj, object args, int param1, int param2) { ChatBabytips.ShowMe(inst_.GetInst()); }