public void init(bool isMain, int idx, heroRecordInfo infos) { this.AchiSprite = Resources.Load <GameObject>("Prefab/UI/Achievement/AchiSprite"); if (isMain) { this.bg1.gameObject.SetActive(false); this.bg.gameObject.SetActive(true); this.info.gameObject.SetActive(true); } else { this.bg1.gameObject.SetActive(true); this.bg.gameObject.SetActive(false); this.info.gameObject.SetActive(false); this.LightFrame.gameObject.SetActive(false); } if (infos.win) { if (infos.mvp) { this.mvp.gameObject.SetActive(true); } else { this.mvp.gameObject.SetActive(false); } this.vectory.gameObject.SetActive(true); this.defeat.gameObject.SetActive(false); } else { this.mvp.gameObject.SetActive(false); this.vectory.gameObject.SetActive(false); this.defeat.gameObject.SetActive(true); } SysHeroMainVo heroMainData = BaseDataMgr.instance.GetHeroMainData(infos.heroid); this.HeroAvatar.mainTexture = ResourceManager.Load <Texture>(heroMainData.avatar_icon, true, true, null, 0, false); if (infos.playercounter != null) { this.killCount.text = infos.playercounter.killHoreCount.ToString(); this.deathCount.text = infos.playercounter.deadCount.ToString(); this.assistCount.text = infos.playercounter.helpKillHoreCount.ToString(); this.Achieve(infos, infos.playercounter, isMain); } int month = infos.gametime.Month; int day = infos.gametime.Day; if (isMain) { this.date.text = string.Concat(new string[] { month.ToString(), "月", day.ToString(), "日", DateTime.Parse(infos.gametime.ToString()).ToString("HH:mm") }); } else { this.date.text = month.ToString() + "月" + day.ToString() + "日"; } this.battleName.text = LanguageManager.Instance.GetStringById("Combatgains_Describe_" + infos.battleid); }
public void Achieve(heroRecordInfo recordInfo, PlayerCounter playercounter, bool isMain) { if (!isMain) { return; } while (this.achive.childCount > 0) { UnityEngine.Object.DestroyImmediate(this.achive.GetChild(0).gameObject); } bool flag = false; Dictionary <int, int> dictionary = new Dictionary <int, int>(); dictionary = playercounter.extKillCount; if (dictionary == null) { return; } List <KeyValuePair <int, int> > list = new List <KeyValuePair <int, int> >(dictionary); if (dictionary.Count > 0) { list.Sort((KeyValuePair <int, int> s1, KeyValuePair <int, int> s2) => s2.Key.CompareTo(s1.Key)); } for (int i = 0; i < list.Count; i++) { int num = list[i].Key; switch (num) { case 3: if (!flag) { if (this.achive.childCount < i + 1) { NGUITools.AddChild(this.achive.gameObject, this.AchiSprite); } this.achive.GetChild(this.achive.childCount - 1).GetComponent <UISprite>().spriteName = "Data_statistics_images_3"; UIWidget arg_3B4_0 = this.achive.GetChild(this.achive.childCount - 1).GetComponent <UISprite>(); int num2 = 36; this.achive.GetChild(this.achive.childCount - 1).GetComponent <UISprite>().height = num2; arg_3B4_0.width = num2; this.achive.GetChild(this.achive.childCount - 1).gameObject.SetActive(true); } break; case 4: if (!flag) { if (this.achive.childCount < i + 1) { NGUITools.AddChild(this.achive.gameObject, this.AchiSprite); } this.achive.GetChild(this.achive.childCount - 1).GetComponent <UISprite>().spriteName = "Data_statistics_images_4"; UIWidget arg_2E7_0 = this.achive.GetChild(this.achive.childCount - 1).GetComponent <UISprite>(); int num2 = 36; this.achive.GetChild(this.achive.childCount - 1).GetComponent <UISprite>().height = num2; arg_2E7_0.width = num2; this.achive.GetChild(this.achive.childCount - 1).gameObject.SetActive(true); flag = true; } break; case 5: { if (this.achive.childCount < i + 1) { NGUITools.AddChild(this.achive.gameObject, this.AchiSprite); } this.achive.GetChild(this.achive.childCount - 1).GetComponent <UISprite>().spriteName = "Data_statistics_images_5"; UIWidget arg_21A_0 = this.achive.GetChild(this.achive.childCount - 1).GetComponent <UISprite>(); int num2 = 36; this.achive.GetChild(this.achive.childCount - 1).GetComponent <UISprite>().height = num2; arg_21A_0.width = num2; this.achive.GetChild(this.achive.childCount - 1).gameObject.SetActive(true); flag = true; break; } default: if (num == 104) { if (this.achive.childCount < i + 1) { NGUITools.AddChild(this.achive.gameObject, this.AchiSprite); } this.achive.GetChild(this.achive.childCount - 1).GetComponent <UISprite>().spriteName = "Data_statistics_images_shen"; UIWidget arg_155_0 = this.achive.GetChild(this.achive.childCount - 1).GetComponent <UISprite>(); int num2 = 36; this.achive.GetChild(this.achive.childCount - 1).GetComponent <UISprite>().height = num2; arg_155_0.width = num2; this.achive.GetChild(this.achive.childCount - 1).gameObject.SetActive(true); } break; } } if (playercounter.isMostMoney) { GameObject gameObject = NGUITools.AddChild(this.achive.gameObject, this.AchiSprite); gameObject.transform.GetComponent <UISprite>().spriteName = "Data_statistics_images_money"; UIWidget arg_476_0 = this.achive.GetChild(this.achive.childCount - 1).GetComponent <UISprite>(); int num = 36; this.achive.GetChild(this.achive.childCount - 1).GetComponent <UISprite>().height = num; arg_476_0.width = num; gameObject.gameObject.SetActive(true); } if (recordInfo.isTeamFight) { this.Friend.SetActive(true); } else { this.Friend.SetActive(false); } this.achive.GetComponent <UIGrid>().Reposition(); }