public void showTime() { if (!CheckIfTopinfoIsVisiable()) { return; } timeInfo.SetActive(true); Tab_Idexperience tab_idexp = TableManager.GetIdexperienceByID(Obj_MyselfPlayer.GetMe().level); lableExpInfo.text = "当前经验: " + Obj_MyselfPlayer.GetMe().exp + "/" + tab_idexp.IDExperience; }
public void updateUserInfo() { Obj_MyselfPlayer myPlayer = Obj_MyselfPlayer.GetMe(); UILabel nameLabel = userName.GetComponent <UILabel>(); nameLabel.text = myPlayer.accountName; UILabel levelLabel = userLevel.GetComponent <UILabel>(); levelLabel.text = myPlayer.level.ToString(); //根据等级得到经验表 Tab_Idexperience tab_idexp = TableManager.GetIdexperienceByID(myPlayer.level); if (tab_idexp == null) { return; } UISlider expSlider = userEXP.GetComponent <UISlider>(); if (expSlider != null && tab_idexp != null && expSlider != null) { Debug.Log("myPlayer:"); Debug.Log(myPlayer); Debug.Log("tab_idexp:"); expSlider.sliderValue = (float)myPlayer.exp / (float)tab_idexp.IDExperience; } //TODO:体力随等级提升,需要等策划配表 UISlider powerSlider = userPowerSlider.GetComponent <UISlider>(); powerSlider.sliderValue = (float)myPlayer.power / (float)tab_idexp.IDPhysicalValue; UILabel powerLabel = userPower.GetComponent <UILabel>(); powerLabel.text = myPlayer.power.ToString() + "/" + tab_idexp.IDPhysicalValue; if (myPlayer.power >= tab_idexp.IDPhysicalValue) { labelTime.gameObject.SetActive(false); labelTimeTitle.gameObject.SetActive(false); } else { labelTime.gameObject.SetActive(true); labelTimeTitle.gameObject.SetActive(true); } UILabel moneyLabel = userMoney.GetComponent <UILabel>(); moneyLabel.text = myPlayer.money.ToString(); UILabel dollarLabel = userDollar.GetComponent <UILabel>(); dollarLabel.text = myPlayer.dollar.ToString(); Hashtable cardList = TableManager.GetCard(); foreach (DictionaryEntry dic in cardList) { HeroInfo hero = new HeroInfo(); hero.templateId = Convert.ToInt32(dic.Key); Obj_MyselfPlayer.GetMe().heroList.Add(hero); } }