public void RefreshUID(ArenaHero hero = null) { if (null == hero) { playerName.text = ""; rankL.text = "排名:"; lvlL.text = "等级:"; fcL.text = "战力:"; SetHeroPos(1); for (int i = 0; i < HeroList.Length; i++) { RefreshIcon(HeroList[i], null); } dearBtn.isEnabled = false; dearBtn.SetState(GUISingleButton.State.Disabled); //gameObject.SetActive(false); return; } //gameObject.SetActive(true); this.hero = hero; pid = hero.pid; playerName.text = hero.nm; rankL.text = "排名:" + hero.rk; lvlL.text = "等级:" + hero.lvl; fcL.text = "战力:" + hero.fc; //Globe.InitHeroSort(hero.herolist); SetHeroPos(hero.heroState); RefreshData(hero.heroState, hero.herolist); dearBtn.isEnabled = true; dearBtn.SetState(GUISingleButton.State.Normal); }
void InitArenaData(object obj, List <ArenaHero> list) { Dictionary <string, object> herodata = obj as Dictionary <string, object>; ArenaHero hero = new ArenaHero(); Dictionary <string, object> heroInfo = herodata["hl"] as Dictionary <string, object>; Dictionary <string, object> heroData; HeroData hd = null; for (int i = 1; i <= heroInfo.Count; i++) { if (i != heroInfo.Count) { heroData = heroInfo[i.ToString()] as Dictionary <string, object>; hd = null; if (heroData.Count > 0) { hd = new HeroData(Convert.ToInt32(heroData["id"]), Convert.ToInt32(heroData["lvl"]), Convert.ToInt32(heroData["gd"]), Convert.ToInt32(heroData["star"])); hd.fc = Convert.ToInt32(heroData["fc"]); } hero.herolist[i - 1] = hd; } else { hero.heroState = Convert.ToInt32(heroInfo[i.ToString()]); } } hero.pid = Convert.ToInt32(herodata["pid"]); hero.nm = Convert.ToString(herodata["nm"]); hero.rk = Convert.ToInt32(herodata["rk"]); hero.lvl = Convert.ToInt32(herodata["lvl"]); hero.fc = Convert.ToInt32(herodata["fc"]); list.Add(hero); }