private void UpdateElement(GameObject element, string name, string headUrl, byte bGrade, uint subGrade, uint heroId, enOBTab curTab, int onlineNum, enStatus status = 0, long localTicks = 0, byte mapType = 0, uint mapId = 0) { CUIFormScript form = Singleton <CUIManager> .instance.GetForm(OB_FORM_PATH); if (form != null) { CUIHttpImageScript componetInChild = Utility.GetComponetInChild <CUIHttpImageScript>(element, "HeadImg"); Image image = Utility.GetComponetInChild <Image>(element, "HeroImg"); Image image2 = Utility.GetComponetInChild <Image>(element, "RankImg"); Image image3 = Utility.GetComponetInChild <Image>(element, "RankImg/SubRankImg"); Text text = Utility.GetComponetInChild <Text>(element, "PlayerName"); Text text2 = Utility.GetComponetInChild <Text>(element, "HeroName"); GameObject obj2 = Utility.FindChild(element, "WatchImg"); Text text3 = Utility.GetComponetInChild <Text>(element, "LocalTime"); Text text4 = Utility.GetComponetInChild <Text>(element, "LocalMap"); Text text5 = Utility.GetComponetInChild <Text>(element, "WatchImg/OnlineCount"); GameObject obj3 = Utility.FindChild(element, "DeleteBtn"); componetInChild.SetImageUrl(headUrl); if (bGrade > 0) { image2.gameObject.CustomSetActive(true); image2.SetSprite(CLadderView.GetRankSmallIconPath(bGrade, subGrade), form, true, false, false); image3.SetSprite(CLadderView.GetSubRankSmallIconPath(bGrade, subGrade), form, true, false, false); } else { image2.gameObject.CustomSetActive(false); } text.text = name; ResHeroCfgInfo dataByKey = GameDataMgr.heroDatabin.GetDataByKey(heroId); if (dataByKey != null) { string prefabPath = string.Format("{0}{1}", CUIUtility.s_Sprite_Dynamic_BustHero_Dir, CSkinInfo.GetHeroSkinPic(heroId, 0)); image.SetSprite(prefabPath, form, false, true, true); text2.text = dataByKey.szName; } else { text2.text = string.Empty; DebugHelper.Assert(false, string.Format("COBSystem UpdateElement hero cfg[{0}] can not be found!", heroId)); } if (curTab != enOBTab.Local) { obj2.CustomSetActive(true); string[] args = new string[] { onlineNum.ToString() }; text5.text = Singleton <CTextManager> .instance.GetText("OB_Desc_3", args); text3.gameObject.SetActive(false); obj3.CustomSetActive(false); text4.gameObject.CustomSetActive(false); } else { obj2.CustomSetActive(false); text3.gameObject.SetActive(true); DateTime time = new DateTime(localTicks); string[] textArray2 = new string[] { time.Month.ToString(), time.Day.ToString(), time.Hour.ToString("D2"), time.Minute.ToString("D2") }; text3.text = Singleton <CTextManager> .instance.GetText("OB_Desc_12", textArray2); obj3.CustomSetActive(status == enStatus.Editor); text4.gameObject.CustomSetActive(true); ResDT_LevelCommonInfo pvpMapCommonInfo = CLevelCfgLogicManager.GetPvpMapCommonInfo(mapType, mapId); if (pvpMapCommonInfo != null) { text4.text = pvpMapCommonInfo.szName; } else { text4.text = string.Empty; } } } }
public static void InitExloreList(CUIFormScript form) { if (form != null) { int length = s_eventIDs.Length; CUIListElementScript elemenet = null; CUIStepListScript component = form.transform.Find("ExploreList").gameObject.GetComponent <CUIStepListScript>(); component.SetElementAmount(length); for (int i = 0; i < length; i++) { elemenet = component.GetElemenet(i); elemenet.GetComponent <CUIEventScript>().m_onClickEventID = s_eventIDs[i]; elemenet.gameObject.transform.Find("TitleBg/ExlporeNameText").GetComponent <Text>().text = Singleton <CTextManager> .instance.GetText(s_exploreTypes[i]); elemenet.gameObject.transform.Find("TitleBg/Image").GetComponent <Image>().color = s_exploreColors[i]; Image image2 = elemenet.gameObject.transform.Find("Icon").gameObject.GetComponent <Image>(); GameObject prefab = CUIUtility.GetSpritePrefeb(CUIUtility.s_Sprite_Dynamic_Adventure_Dir + (i + 1), false, false); if (prefab != null) { image2.SetSprite(prefab); } GameObject gameObject = elemenet.transform.FindChild("Lock").gameObject; GameObject obj4 = elemenet.transform.FindChild("Unlock").gameObject; RES_SPECIALFUNCUNLOCK_TYPE type = s_unlockTypes[i]; if (Singleton <CFunctionUnlockSys> .instance.FucIsUnlock(type)) { image2.color = CUIUtility.s_Color_White; gameObject.CustomSetActive(false); } else { image2.color = CUIUtility.s_Color_GrayShader; gameObject.CustomSetActive(true); ResSpecialFucUnlock dataByKey = GameDataMgr.specialFunUnlockDatabin.GetDataByKey((uint)type); if (dataByKey != null) { gameObject.GetComponentInChildren <Text>().text = Utility.UTF8Convert(dataByKey.szLockedTip); } } if (s_unlockTypes[i] == RES_SPECIALFUNCUNLOCK_TYPE.RES_SPECIALFUNCUNLOCKTYPE_NONE) { int lastChapter = CAdventureSys.GetLastChapter(1); ResChapterInfo info = GameDataMgr.chapterInfoDatabin.GetDataByKey((long)lastChapter); if (info != null) { obj4.CustomSetActive(true); obj4.GetComponentInChildren <Text>().text = string.Format(Singleton <CTextManager> .instance.GetText("Adventure_Chapter_Max_Tips"), Utility.UTF8Convert(info.szChapterName)); } } else if (s_unlockTypes[i] == RES_SPECIALFUNCUNLOCK_TYPE.RES_SPECIALFUNCUNLOCKTYPE_ARENA) { if ((Singleton <CArenaSystem> .GetInstance().m_fightHeroInfoList == null) || (Singleton <CArenaSystem> .GetInstance().m_fightHeroInfoList.stArenaInfo.dwSelfRank == 0)) { obj4.CustomSetActive(false); } else { string str = string.Empty; str = string.Format(Singleton <CTextManager> .GetInstance().GetText("ExploreArenaRankText"), Singleton <CArenaSystem> .GetInstance().m_fightHeroInfoList.stArenaInfo.dwSelfRank); obj4.gameObject.transform.FindChild("Text").gameObject.GetComponent <Text>().text = str; obj4.CustomSetActive(true); } } else if (s_unlockTypes[i] == RES_SPECIALFUNCUNLOCK_TYPE.RES_SPECIALFUNCUNLOCKTYPE_LIUGUOYUANZHENG) { BurnExpeditionModel model = Singleton <BurnExpeditionController> .GetInstance().model; if (model._data == null) { obj4.CustomSetActive(false); } else { string str2 = string.Empty; if (model.IsAllCompelte()) { str2 = string.Format(Singleton <CTextManager> .GetInstance().GetText("ExploreBurnFinishText"), new object[0]); } else { str2 = string.Format(Singleton <CTextManager> .GetInstance().GetText("ExploreBurnText"), Math.Max(1, model.Get_LastUnlockLevelIndex(model.curDifficultyType) + 1)); } obj4.gameObject.transform.FindChild("Text").gameObject.GetComponent <Text>().text = str2; obj4.CustomSetActive(true); } } } component.SelectElementImmediately(1); Text text2 = form.gameObject.transform.FindChild("AwardGroup/Name1").gameObject.GetComponent <Text>(); Text text3 = form.gameObject.transform.FindChild("AwardGroup/Name2").gameObject.GetComponent <Text>(); Image image = form.gameObject.transform.FindChild("AwardGroup/Icon1").gameObject.GetComponent <Image>(); Image image4 = form.gameObject.transform.FindChild("AwardGroup/Icon2").gameObject.GetComponent <Image>(); text2.gameObject.CustomSetActive(false); text3.gameObject.CustomSetActive(false); image.gameObject.CustomSetActive(false); image4.gameObject.CustomSetActive(false); uint key = 0; try { key = uint.Parse(Singleton <CTextManager> .GetInstance().GetText("ArenaAwardHeroId")); } catch (Exception) { } if (key != 0) { ResHeroCfgInfo info2 = GameDataMgr.heroDatabin.GetDataByKey(key); if (!Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().IsHaveHero(key, false) && (info2 != null)) { text2.gameObject.CustomSetActive(true); text2.text = string.Format(Singleton <CTextManager> .GetInstance().GetText("ArenaAwardHero"), info2.szName); image.gameObject.CustomSetActive(true); image.SetSprite(string.Format("{0}{1}", CUIUtility.s_Sprite_Dynamic_Icon_Dir, CSkinInfo.GetHeroSkinPic(key, 0)), form, true, false, false); } } key = 0; try { key = uint.Parse(Singleton <CTextManager> .GetInstance().GetText("BurningAwardHeroId")); } catch (Exception) { } if (key != 0) { ResHeroCfgInfo info3 = GameDataMgr.heroDatabin.GetDataByKey(key); if (!Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().IsHaveHero(key, false) && (info3 != null)) { text3.gameObject.CustomSetActive(true); text3.text = string.Format(Singleton <CTextManager> .GetInstance().GetText("BurningAwardHero"), info3.szName); image4.gameObject.CustomSetActive(true); image4.SetSprite(string.Format("{0}{1}", CUIUtility.s_Sprite_Dynamic_Icon_Dir, CSkinInfo.GetHeroSkinPic(key, 0)), form, true, false, false); } } } }
public HeroInfoSideItem(COM_PLAYERCAMP _listCamp, HeroKDA _heroKDA, int _listIndex, GameObject goNode) { this.listCamp = _listCamp; this.listIndex = _listIndex; this._headImg = Utility.GetComponetInChild <Image>(goNode, "Head"); this._reviveTxt = Utility.GetComponetInChild <Text>(goNode, "Revive"); this._levelText = Utility.GetComponetInChild <Text>(goNode, "Level"); this._skill3Bg = Utility.FindChild(goNode, "Skill-bg"); this._skill3Canbe = Utility.FindChild(goNode, "Skill-canbe"); this._nameText = Utility.GetComponetInChild <Text>(goNode, "Name"); this._heroInfo = _heroKDA; this._skill3Bg.CustomSetActive(true); this._nameText.gameObject.CustomSetActive(false); CPlayerKDAStat playerKDAStat = Singleton <BattleLogic> .GetInstance().battleStat.m_playerKDAStat; DictionaryView <uint, PlayerKDA> .Enumerator enumerator = playerKDAStat.GetEnumerator(); bool flag = false; while (enumerator.MoveNext()) { KeyValuePair <uint, PlayerKDA> current = enumerator.Current; PlayerKDA value = current.get_Value(); if (value.PlayerCamp == _listCamp) { ListView <HeroKDA> .Enumerator enumerator2 = value.GetEnumerator(); while (enumerator2.MoveNext()) { if (enumerator2.Current.HeroId == _heroKDA.HeroId) { this._nameText.gameObject.CustomSetActive(true); this._nameText.set_text(value.PlayerName); flag = true; break; } } } if (flag) { break; } } this._headImg.SetSprite(string.Format("{0}{1}", CUIUtility.s_Sprite_Dynamic_BustCircle_Dir, CSkinInfo.GetHeroSkinPic((uint)this._heroInfo.HeroId, 0u)), Singleton <CBattleSystem> .GetInstance().WatchFormScript, true, false, false, false); this.ValidateLevel(); this.ValidateReviceCD(); this.ValidateSkill3(); }
private void InitBtnInfo() { List <PoolObjHandle <ActorRoot> > list = ActorHelper.FilterActors(Singleton <GameObjMgr> .get_instance().HeroActors, new ActorFilterDelegate(Singleton <BattleLogic> .get_instance().FilterEnemyActor)); this.m_iCurEnemyPlayerCount = list.get_Count(); if (this.m_iCurEnemyPlayerCount > 5) { this.m_iCurEnemyPlayerCount = 5; } CEnemyHeroAtkBtn.m_UI3DCamera = Singleton <Camera_UI3D> .GetInstance().GetCurrentCamera(); this.m_ui3dRes = Singleton <CGameObjectPool> .GetInstance().GetGameObject("Prefab_Skill_Effects/Common_Effects/EnemyHeroAttack", 0); float num = 1f; if (Singleton <CBattleSystem> .get_instance().FightFormScript != null) { num = Singleton <CBattleSystem> .get_instance().FightFormScript.GetScreenScaleValue(); } if (this.m_ui3dRes != null) { this.m_ui3dRes.transform.SetParent(CEnemyHeroAtkBtn.m_UI3DCamera.transform, true); if (this.m_objSelectedImg == null) { this.m_objSelectedImg = this.m_ui3dRes.transform.FindChild("selected").gameObject; if (this.m_objSelectedImg) { Sprite3D component = this.m_objSelectedImg.GetComponent <Sprite3D>(); if (component) { component.width *= num; component.height *= num; } this.m_objDirection = this.m_objSelectedImg.transform.FindChild("direction").gameObject; if (this.m_objDirection) { Vector3 position = this.m_objDirection.transform.position; position.y *= num; this.m_objDirection.transform.position = position; component = this.m_objDirection.GetComponent <Sprite3D>(); if (component) { component.width *= num; component.height *= num; } } } } if (this.m_attackLinker == null) { this.m_objLinker = this.m_ui3dRes.transform.FindChild("linker").gameObject; if (this.m_objLinker) { this.m_attackLinker = this.m_objLinker.GetComponent <LineRenderer>(); if (this.m_attackLinker != null && CEnemyHeroAtkBtn.m_UI3DCamera) { this.m_attackLinker.SetVertexCount(2); this.m_attackLinker.useWorldSpace = true; } } } } for (int i = 0; i < this.m_iCurEnemyPlayerCount; i++) { Transform transform = this.m_objPanelEnemyHeroAtk.transform.FindChild(CEnemyHeroAtkBtn.m_arrHeroBtnNames[i]); string heroSkinPic = CSkinInfo.GetHeroSkinPic((uint)list.get_Item(i).get_handle().TheActorMeta.ConfigId, 0u); string prefabPath = CUIUtility.s_Sprite_Dynamic_BustCircle_Dir + heroSkinPic; Image component2 = transform.GetComponent <Image>(); if (component2) { component2.SetSprite(prefabPath, Singleton <CBattleSystem> .GetInstance().FormScript, true, false, false, false); } if (this.m_ui3dRes != null) { GameObject gameObject = this.m_ui3dRes.transform.FindChild("hp_" + i).gameObject; if (gameObject) { Sprite3D component3 = gameObject.GetComponent <Sprite3D>(); if (component3) { component3.width *= num; component3.height *= num; } GameObject gameObject2 = gameObject.transform.FindChild("hp").gameObject; if (gameObject2) { Sprite3D component4 = gameObject2.GetComponent <Sprite3D>(); component4.width *= num; component4.height *= num; this.m_arrBtnInfo[i] = new CEnemyHeroAtkBtn.BTN_INFO(transform, list.get_Item(i), CEnemyHeroAtkBtn.ENM_ENEMY_HERO_STATE.ENM_ENEMY_HERO_STATE_TOOFAR, true, gameObject, component4); } } } } }
private static void SetPlayerStat(CUIFormScript formScript, GameObject item, PlayerKDA playerKDA, HeroKDA kda) { Text componetInChild = Utility.GetComponetInChild <Text>(item, "Txt_PlayerName"); componetInChild.text = playerKDA.PlayerName; componetInChild.color = (playerKDA.PlayerCamp != COM_PLAYERCAMP.COM_PLAYERCAMP_1) ? new Color(0.545f, 0f, 0f, 1f) : new Color(0.031f, 0.961f, 0f, 1f); ResHeroCfgInfo dataByKey = GameDataMgr.heroDatabin.GetDataByKey((uint)kda.HeroId); DebugHelper.Assert(dataByKey != null); item.transform.Find("Txt_HeroName").gameObject.GetComponent <Text>().text = StringHelper.UTF8BytesToString(ref dataByKey.szName); string str = (kda.numKill >= 10) ? kda.numKill.ToString() : string.Format(" {0} ", kda.numKill.ToString()); string str2 = (kda.numDead >= 10) ? kda.numDead.ToString() : string.Format(" {0} ", kda.numDead.ToString()); item.transform.Find("Txt_KDA").gameObject.GetComponent <Text>().text = string.Format("{0} / {1}", str, str2); item.transform.Find("Txt_Hurt").gameObject.GetComponent <Text>().text = kda.hurtToEnemy.ToString(); item.transform.Find("Txt_HurtTaken").gameObject.GetComponent <Text>().text = kda.hurtTakenByEnemy.ToString(); item.transform.Find("Txt_Heal").gameObject.GetComponent <Text>().text = kda.hurtToHero.ToString(); item.transform.Find("KillerImg").gameObject.GetComponent <Image>().SetSprite(string.Format("{0}{1}", CUIUtility.s_Sprite_Dynamic_Icon_Dir, CSkinInfo.GetHeroSkinPic((uint)kda.HeroId, 0)), formScript, true, false, false); item.CustomSetActive(true); }
public static string GetHero_Icon(uint ConfigID, uint SkinID = 0, bool bSmall = false) { string heroSkinPic = CSkinInfo.GetHeroSkinPic(ConfigID, SkinID); return(string.Format("{0}{1}", !bSmall ? CUIUtility.s_Sprite_Dynamic_BustCircle_Dir : CUIUtility.s_Sprite_Dynamic_BustCircleSmall_Dir, heroSkinPic)); }
private void UpdateElement(GameObject element, string name, string headUrl, byte bGrade, uint subGrade, uint heroId, COBSystem.enOBTab curTab, int onlineNum, COBSystem.enStatus status = COBSystem.enStatus.Normal, long localTicks = 0L, byte mapType = 0, uint mapId = 0u, string localName = "") { CUIFormScript form = Singleton <CUIManager> .get_instance().GetForm(COBSystem.OB_FORM_PATH); if (form == null) { return; } CUIHttpImageScript componetInChild = Utility.GetComponetInChild <CUIHttpImageScript>(element, "HeadImg"); Image componetInChild2 = Utility.GetComponetInChild <Image>(element, "HeroImg"); Image componetInChild3 = Utility.GetComponetInChild <Image>(element, "RankImg"); Image componetInChild4 = Utility.GetComponetInChild <Image>(element, "RankImg/SubRankImg"); Text componetInChild5 = Utility.GetComponetInChild <Text>(element, "PlayerName"); Text componetInChild6 = Utility.GetComponetInChild <Text>(element, "HeroName"); GameObject obj = Utility.FindChild(element, "WatchImg"); Text componetInChild7 = Utility.GetComponetInChild <Text>(element, "LocalTime"); Text componetInChild8 = Utility.GetComponetInChild <Text>(element, "LocalMap"); Text componetInChild9 = Utility.GetComponetInChild <Text>(element, "WatchImg/OnlineCount"); GameObject obj2 = Utility.FindChild(element, "DeleteBtn"); componetInChild.SetImageUrl(headUrl); if (bGrade > 0) { componetInChild3.gameObject.CustomSetActive(true); componetInChild3.SetSprite(CLadderView.GetRankSmallIconPath(bGrade, subGrade), form, true, false, false, false); componetInChild4.SetSprite(CLadderView.GetSubRankSmallIconPath(bGrade, subGrade), form, true, false, false, false); } else { componetInChild3.gameObject.CustomSetActive(false); } componetInChild5.text = name; ResHeroCfgInfo dataByKey = GameDataMgr.heroDatabin.GetDataByKey(heroId); if (dataByKey != null) { string prefabPath = string.Format("{0}{1}", CUIUtility.s_Sprite_Dynamic_BustHero_Dir, CSkinInfo.GetHeroSkinPic(heroId, 0u)); componetInChild2.SetSprite(prefabPath, form, false, true, true, false); componetInChild6.text = dataByKey.szName; } else { componetInChild6.text = string.Empty; DebugHelper.Assert(false, string.Format("COBSystem UpdateElement hero cfg[{0}] can not be found!", heroId)); } if (curTab != COBSystem.enOBTab.Local) { obj.CustomSetActive(true); componetInChild9.text = Singleton <CTextManager> .get_instance().GetText("OB_Desc_3", new string[] { onlineNum.ToString() }); componetInChild7.gameObject.SetActive(false); obj2.CustomSetActive(false); componetInChild8.gameObject.CustomSetActive(false); } else { obj.CustomSetActive(false); componetInChild7.gameObject.SetActive(true); DateTime dateTime = new DateTime(localTicks); componetInChild7.text = Singleton <CTextManager> .get_instance().GetText("OB_Desc_12", new string[] { dateTime.get_Month().ToString(), dateTime.get_Day().ToString(), dateTime.get_Hour().ToString("D2"), dateTime.get_Minute().ToString("D2") }); obj2.CustomSetActive(status == COBSystem.enStatus.Editor); componetInChild8.gameObject.CustomSetActive(true); ResDT_LevelCommonInfo pvpMapCommonInfo = CLevelCfgLogicManager.GetPvpMapCommonInfo(mapType, mapId); if (pvpMapCommonInfo != null) { componetInChild8.text = pvpMapCommonInfo.szName; } else { componetInChild8.text = string.Empty; } componetInChild6.text = string.Empty; } }
public void Validate(HeroKDA kdaData) { if (kdaData != null) { this.kdaData = kdaData; } if (this.kdaData != null) { this.icon.SetSprite(string.Format("{0}{1}", CUIUtility.s_Sprite_Dynamic_Icon_Dir, CSkinInfo.GetHeroSkinPic((uint)this.kdaData.HeroId, 0)), Singleton <CBattleSystem> .instance.FormScript, true, false, false); Player ownerPlayer = ActorHelper.GetOwnerPlayer(ref this.kdaData.actorHero); this.playerName.text = ownerPlayer.Name; this.heroName.text = this.kdaData.actorHero.handle.TheStaticData.TheResInfo.Name; this.level.text = this.kdaData.actorHero.handle.ValueComponent.actorSoulLevel.ToString(); this.killNum.text = this.kdaData.numKill.ToString(); this.deadNum.text = this.kdaData.numDead.ToString(); this.killMon.text = (this.kdaData.numKillMonster + this.kdaData.numKillSoldier).ToString(); this.killMon.text = this.kdaData.TotalCoin.ToString(); this.assistNum.text = this.kdaData.numAssist.ToString(); int num = 0; for (int i = 0; i < 6; i++) { ushort equipID = this.kdaData.Equips[i].m_equipID; if (equipID != 0) { CUICommonSystem.SetEquipIcon(equipID, this.equipList[num++].gameObject, Singleton <CBattleSystem> .instance.FormScript); } } for (int j = num; j < 6; j++) { this.equipList[j].gameObject.GetComponent <Image>().SetSprite(string.Format("{0}EquipmentSpace", CUIUtility.s_Sprite_Dynamic_Talent_Dir), Singleton <CBattleSystem> .instance.FormScript, true, false, false); } if (ownerPlayer == Singleton <GamePlayerCenter> .GetInstance().GetHostPlayer()) { this.playerName.color = CUIUtility.s_Text_Color_Self; this.mineBg.CustomSetActive(true); } else { if (ownerPlayer.PlayerCamp == COM_PLAYERCAMP.COM_PLAYERCAMP_1) { this.playerName.color = CUIUtility.s_Text_Color_Camp_1; } else { this.playerName.color = CUIUtility.s_Text_Color_Camp_2; } this.mineBg.CustomSetActive(false); } } }
private void InitHeroPanelHeroInfo(uint uiObjId, Transform trHeroPanel, CHostHeroDamage objHostHeroDamage) { if (trHeroPanel == null || objHostHeroDamage == null) { return; } Transform transform = trHeroPanel.FindChild("PanelTop"); if (transform) { int num = 0; string text = null; string text2 = null; byte b = 0; byte b2 = 0; ActorTypeDef actorTypeDef = ActorTypeDef.Invalid; if (objHostHeroDamage.GetDamageActorInfo(uiObjId, ref text, ref text2, ref actorTypeDef, ref num, ref b, ref b2)) { Transform transform2 = transform.FindChild("Imghead"); if (transform2) { Transform transform3 = transform2.FindChild("head"); if (transform3) { Image component = transform3.GetComponent <Image>(); if (component) { string prefabPath; if (actorTypeDef == ActorTypeDef.Actor_Type_Hero) { string heroSkinPic = CSkinInfo.GetHeroSkinPic((uint)num, 0u); prefabPath = CUIUtility.s_Sprite_Dynamic_Icon_Dir + heroSkinPic; } else if (actorTypeDef == ActorTypeDef.Actor_Type_Organ) { prefabPath = KillNotifyUT.Convert_DetailInfo_KillInfo(new KillDetailInfo { Killer = Singleton <GameObjMgr> .instance.GetActor(uiObjId) }).KillerImgSrc; } else if (actorTypeDef == ActorTypeDef.Actor_Type_Monster) { ResMonsterCfgInfo dataCfgInfoByCurLevelDiff = MonsterDataHelper.GetDataCfgInfoByCurLevelDiff(num); if (dataCfgInfoByCurLevelDiff != null && !string.IsNullOrEmpty(dataCfgInfoByCurLevelDiff.szBossIcon)) { prefabPath = dataCfgInfoByCurLevelDiff.szBossIcon; } else if (b2 == 1) { prefabPath = KillNotify.monster_icon; } else if (b == 7) { prefabPath = CHostHeroDeadInfo.m_dragon_icon_3v3; } else if (b == 9) { prefabPath = KillNotify.dragon_icon; } else if (b == 8) { prefabPath = CHostHeroDeadInfo.m_strDragonBig; } else { prefabPath = KillNotify.yeguai_icon; } } else { prefabPath = KillNotify.monster_icon; } component.SetSprite(prefabPath, this.m_heroDeadInfoForm, true, false, false, false); } } } Transform transform4 = transform.FindChild("heroName"); if (transform4) { Text component2 = transform4.GetComponent <Text>(); if (component2) { string text3 = text; if (!string.IsNullOrEmpty(text3)) { int num2 = text3.IndexOf('('); string text4 = text3.Substring(num2 + 1, text3.get_Length() - num2 - 2); component2.set_text(text4); } } } Transform transform5 = transform.FindChild("playerName"); if (transform5) { Text component3 = transform5.GetComponent <Text>(); if (component3) { if (!string.IsNullOrEmpty(text2)) { component3.set_text(text2); transform5.gameObject.CustomSetActive(true); } else { transform5.gameObject.CustomSetActive(false); } } } } } }
public HeroInfoItem(COM_PLAYERCAMP _listCamp, int _listIndex, HeroKDA _heroKDA, GameObject baseInfoItem, GameObject equipInfoItem) { this.listCamp = _listCamp; this.listIndex = _listIndex; this._heroInfo = _heroKDA; this._baseInfoItem = baseInfoItem; this._equipInfoItem = equipInfoItem; this._baseInfoItem.GetComponent <CUIEventScript>().enabled = true; this._headImg = Utility.GetComponetInChild <Image>(baseInfoItem, "Head"); this._reviveTxt = Utility.GetComponetInChild <Text>(baseInfoItem, "Revive"); this._levelText = Utility.GetComponetInChild <Text>(baseInfoItem, "Level"); this._kdaText = Utility.GetComponetInChild <Text>(baseInfoItem, "KDA"); this._moneyText = Utility.GetComponetInChild <Text>(baseInfoItem, "Money"); this._hostGo = Utility.FindChild(baseInfoItem, "Host"); this._hostGo.CustomSetActive(this._heroInfo.actorHero.get_handle().ObjID == Singleton <CBattleSystem> .GetInstance().WatchForm.TargetHeroId); this._emptyGo = Utility.FindChild(baseInfoItem, "Empty"); this._emptyGo.CustomSetActive(false); this._equipInfoItem.GetComponent <CUIEventScript>().enabled = true; this._equipIcons = new Image[6]; for (int i = 0; i < 6; i++) { this._equipIcons[i] = Utility.GetComponetInChild <Image>(equipInfoItem, "Icon_" + i); this._equipIcons[i].gameObject.CustomSetActive(true); } this._headImg.SetSprite(string.Format("{0}{1}", CUIUtility.s_Sprite_Dynamic_BustCircle_Dir, CSkinInfo.GetHeroSkinPic((uint)this._heroInfo.HeroId, 0u)), Singleton <CBattleSystem> .GetInstance().WatchFormScript, true, false, false, false); this.ValidateLevel(); this.ValidateKDA(); this.ValidateMoney(); this.ValidateEquip(); this.ValidateReviceCD(); }
public static void InitExloreList(CUIFormScript form) { if (form == null) { return; } int num = CExploreView.s_eventIDs.Length; CUIStepListScript component = form.transform.Find("ExploreList").gameObject.GetComponent <CUIStepListScript>(); component.SetElementAmount(num); for (int i = 0; i < num; i++) { CUIListElementScript elemenet = component.GetElemenet(i); CUIEventScript component2 = elemenet.GetComponent <CUIEventScript>(); component2.m_onClickEventID = CExploreView.s_eventIDs[i]; Text component3 = elemenet.gameObject.transform.Find("TitleBg/ExlporeNameText").GetComponent <Text>(); component3.text = Singleton <CTextManager> .get_instance().GetText(CExploreView.s_exploreTypes[i]); Image component4 = elemenet.gameObject.transform.Find("TitleBg/Image").GetComponent <Image>(); component4.color = CExploreView.s_exploreColors[i]; Image component5 = elemenet.gameObject.transform.Find("Icon").gameObject.GetComponent <Image>(); GameObject spritePrefeb = CUIUtility.GetSpritePrefeb(CUIUtility.s_Sprite_Dynamic_Adventure_Dir + (i + 1), false, false); if (spritePrefeb != null) { component5.SetSprite(spritePrefeb, false); } GameObject gameObject = elemenet.transform.FindChild("Lock").gameObject; GameObject gameObject2 = elemenet.transform.FindChild("Unlock").gameObject; RES_SPECIALFUNCUNLOCK_TYPE rES_SPECIALFUNCUNLOCK_TYPE = CExploreView.s_unlockTypes[i]; if (Singleton <CFunctionUnlockSys> .get_instance().FucIsUnlock(rES_SPECIALFUNCUNLOCK_TYPE)) { component5.color = CUIUtility.s_Color_White; gameObject.CustomSetActive(false); } else { component5.color = CUIUtility.s_Color_GrayShader; gameObject.CustomSetActive(true); ResSpecialFucUnlock dataByKey = GameDataMgr.specialFunUnlockDatabin.GetDataByKey(rES_SPECIALFUNCUNLOCK_TYPE); if (dataByKey != null) { gameObject.GetComponentInChildren <Text>().text = Utility.UTF8Convert(dataByKey.szLockedTip); } } if (CExploreView.s_unlockTypes[i] == null) { int lastChapter = CAdventureSys.GetLastChapter(1); ResChapterInfo dataByKey2 = GameDataMgr.chapterInfoDatabin.GetDataByKey((long)lastChapter); if (dataByKey2 != null) { gameObject2.CustomSetActive(true); gameObject2.GetComponentInChildren <Text>().text = string.Format(Singleton <CTextManager> .get_instance().GetText("Adventure_Chapter_Max_Tips"), Utility.UTF8Convert(dataByKey2.szChapterName)); } } else if (CExploreView.s_unlockTypes[i] == 9) { if (Singleton <CArenaSystem> .GetInstance().m_fightHeroInfoList == null || Singleton <CArenaSystem> .GetInstance().m_fightHeroInfoList.stArenaInfo.dwSelfRank == 0u) { gameObject2.CustomSetActive(false); } else { string text = string.Empty; text = string.Format(Singleton <CTextManager> .GetInstance().GetText("ExploreArenaRankText"), Singleton <CArenaSystem> .GetInstance().m_fightHeroInfoList.stArenaInfo.dwSelfRank); gameObject2.gameObject.transform.FindChild("Text").gameObject.GetComponent <Text>().text = text; gameObject2.CustomSetActive(true); } } else if (CExploreView.s_unlockTypes[i] == 4) { BurnExpeditionModel model = Singleton <BurnExpeditionController> .GetInstance().model; if (model._data == null) { gameObject2.CustomSetActive(false); } else { string text2 = string.Empty; if (model.IsAllCompelte()) { text2 = string.Format(Singleton <CTextManager> .GetInstance().GetText("ExploreBurnFinishText"), new object[0]); } else { text2 = string.Format(Singleton <CTextManager> .GetInstance().GetText("ExploreBurnText"), Math.Max(1, model.Get_LastUnlockLevelIndex(model.curDifficultyType) + 1)); } gameObject2.gameObject.transform.FindChild("Text").gameObject.GetComponent <Text>().text = text2; gameObject2.CustomSetActive(true); } } } component.SelectElementImmediately(1); Text component6 = form.gameObject.transform.FindChild("AwardGroup/Name1").gameObject.GetComponent <Text>(); Text component7 = form.gameObject.transform.FindChild("AwardGroup/Name2").gameObject.GetComponent <Text>(); Image component8 = form.gameObject.transform.FindChild("AwardGroup/Icon1").gameObject.GetComponent <Image>(); Image component9 = form.gameObject.transform.FindChild("AwardGroup/Icon2").gameObject.GetComponent <Image>(); component6.gameObject.CustomSetActive(false); component7.gameObject.CustomSetActive(false); component8.gameObject.CustomSetActive(false); component9.gameObject.CustomSetActive(false); uint num2 = 0u; string empty = string.Empty; try { num2 = uint.Parse(Singleton <CTextManager> .GetInstance().GetText("ArenaAwardHeroId")); } catch (Exception) { } if (num2 != 0u) { ResHeroCfgInfo dataByKey3 = GameDataMgr.heroDatabin.GetDataByKey(num2); if (!Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().IsHaveHero(num2, false) && dataByKey3 != null) { component6.gameObject.CustomSetActive(true); component6.text = string.Format(Singleton <CTextManager> .GetInstance().GetText("ArenaAwardHero"), dataByKey3.szName); component8.gameObject.CustomSetActive(true); component8.SetSprite(string.Format("{0}{1}", CUIUtility.s_Sprite_Dynamic_Icon_Dir, CSkinInfo.GetHeroSkinPic(num2, 0u)), form, true, false, false, false); } } num2 = 0u; try { num2 = uint.Parse(Singleton <CTextManager> .GetInstance().GetText("BurningAwardHeroId")); } catch (Exception) { } if (num2 != 0u) { ResHeroCfgInfo dataByKey4 = GameDataMgr.heroDatabin.GetDataByKey(num2); if (!Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().IsHaveHero(num2, false) && dataByKey4 != null) { component7.gameObject.CustomSetActive(true); component7.text = string.Format(Singleton <CTextManager> .GetInstance().GetText("BurningAwardHero"), dataByKey4.szName); component9.gameObject.CustomSetActive(true); component9.SetSprite(string.Format("{0}{1}", CUIUtility.s_Sprite_Dynamic_Icon_Dir, CSkinInfo.GetHeroSkinPic(num2, 0u)), form, true, false, false, false); } } if (CSysDynamicBlock.bLobbyEntryBlocked) { Transform transform = form.transform.FindChild("AwardGroup"); if (transform) { transform.gameObject.CustomSetActive(false); } } }