//开始显示Logo public async ETTask ShowLogo() { if (battleModule.matchInfo.type > 1100 && battleModule.matchInfo.type <= 1199) { return; } uiData.go_LogoNode.SetActive(true); if (battleModule.matchInfo.type > 1100 && battleModule.matchInfo.type < 1199) { uiData.go_HQGJNode.SetActive(true); uiData.go_OtherNode.SetActive(false); } else { uiData.go_HQGJNode.SetActive(false); uiData.go_OtherNode.SetActive(true); uiData.image_LogoImg.sprite = GameObjectTool.LoadSprite("LOGO_" + battleModule.matchInfo.type); uiData.image_NameImg.sprite = GameObjectTool.LoadSprite("mz_" + battleModule.matchInfo.type); } await ModelComTools.TimerComponent.WaitAsync(2500); uiData.go_LogoNode.SetActive(false); }
private void SetAdmissItemUIInfo(int i, GameObject instanceAdmissionUI) { Text text_TextHorseNumber = instanceAdmissionUI.transform.Find("TextHorseNumber").GetComponent <Text>(); Text text_TextHorseName = instanceAdmissionUI.transform.Find("TextHorseName").GetComponent <Text>(); Text text_TextHorsePower = instanceAdmissionUI.transform.Find("TextHorsePower").GetComponent <Text>(); text_TextHorseNumber.text = string.Format("{0}", (allHorseView[i].data.Id + 1) + ""); text_TextHorseName.text = allHorseView[i].data.horseName; Image image_ItemMatchBg = instanceAdmissionUI.transform.Find("SaiMaJianJieDiTu").GetComponent <Image>(); //GameObjectTool.TextOverFlowLimitWidth(text_TextHorseName, allHorseView[i].data.horseName); //if (allHorseView[i].data.horseName.Contains("famousHorse__")) //{ // GameObjectTool.TextOverFlowLimitWidth(text_TextHorseName, allHorseView[i].data.horseName.Substring(13)); //} text_TextHorsePower.text = allHorseView[i].data.fightValue + ""; MatchModule matchModule = UtilsModuleManager.GetModule(ModuleType.MatchModule) as MatchModule; if (matchModule.isSelfPlayer(allHorseView[i].data.playerUid)) { image_ItemMatchBg.sprite = GameObjectTool.LoadSprite("templateBg1"); //text_TextHorseNumber.text = $"<color=#ffb400>{text_TextHorseNumber.text}</color>"; //text_TextHorseName.text= $"<color=#ffb400>{text_TextHorseName.text}</color>"; } }
private void InitSkillInfo() { chatList.Clear(); //初始几条信息 var tips = GameObjectTool.GetLanguage(50139195); var tips1 = GameObjectTool.GetLanguage(50139196); var tips2 = GameObjectTool.GetLanguage(50139197); var tips3 = GameObjectTool.GetLanguage(50139198); var tips4 = GameObjectTool.GetLanguage(50139199); chatList.Add(tips); chatList.Add(tips1); chatList.Add(tips2); if (battleModule.UsingFrameSync) { chatList.Add(tips3); } else { chatList.Add(tips4); } uiData.loopverticalscrollrect_SkillInfoList.ClearCells(); uiData.loopverticalscrollrect_SkillInfoList.getObjectAction = OnCreateSkillInfoListItem; uiData.loopverticalscrollrect_SkillInfoList.totalCount = chatList.Count; uiData.loopverticalscrollrect_SkillInfoList.RefillCells(); }
private void SetSkillBuffInfo() { if (skillIndex >= skillIdList.Count) { return; } image_Fill.fillAmount = 1; image_SkillIconZZ.fillAmount = 0; text_SkillCD.gameObject.SetActive(false); //设置技能图片 var horseSkillDefine = ModelComTools.Config.GetHorseSkillByID(skillIdList[skillIndex]); if (horseSkillDefine != null) //马匹技能 { text_SkillName.text = GameObjectTool.GetLanguage(horseSkillDefine.Name); //ModelComTools.Config.GetLanguageByID(horseSkillDefine.Name).Chinese; image_SkillIcon.sprite = GameObjectTool.LoadSprite(horseSkillDefine.Image); } else//骑手技能 { text_SkillCD.gameObject.SetActive(false); var humanSkillDefine = ModelComTools.Config.GetHumanSkillByID(skillIdList[skillIndex]); if (humanSkillDefine != null) { text_SkillName.text = GameObjectTool.GetLanguage(humanSkillDefine.Name);//ModelComTools.Config.GetLanguageByID(humanSkillDefine.Name).Chinese; image_SkillIcon.sprite = GameObjectTool.LoadSprite(humanSkillDefine.Image); } } }
public void SetSkillIdAndExistTime(int skillId, float existTime, string skillName) { this.skillId = skillId; this.existTime = existTime; currTime = 0f; isInited = true; image_Fill.fillAmount = 1; image_SkillIconZZ.fillAmount = 1; text_SkillCD.gameObject.SetActive(existTime != -1); transform.gameObject.SetActive(true); //设置技能图片 var horseSkillDefine = ModelComTools.Config.GetHorseSkillByID(this.skillId); if (horseSkillDefine != null)//马匹技能 { image_SkillIcon.sprite = GameObjectTool.LoadSprite(horseSkillDefine.Image); } else//骑手技能 { var humanSkillDefine = ModelComTools.Config.GetHumanSkillByID(this.skillId); if (humanSkillDefine != null) { image_SkillIcon.sprite = GameObjectTool.LoadSprite(humanSkillDefine.Image); } } }
private Sprite GetSpriteByIndex(FieldAndWeather weather) { var spName = string.Empty; switch (weather) { case FieldAndWeather.Sunny: spName = "sunny"; break; case FieldAndWeather.Rainy: spName = "raining"; break; case FieldAndWeather.Foggy: spName = "frog"; break; case FieldAndWeather.Turf: spName = "grassland"; break; case FieldAndWeather.Dirt: spName = "grassland_bm"; break; case FieldAndWeather.Sand: spName = "sand"; break; default: break; } return(GameObjectTool.LoadSprite(spName)); }
//显示对抗赛轮次 public async ETTask ShowCombatInfo() { uiData.go_CombatVSNode.SetActive(false); uiData.go_CombatNode.SetActive(true); var tips = GameObjectTool.GetLanguage(50000008); uiData.text_CombatTitle.text = string.Format(tips, battleModule.matchInfo.roundIndex); for (int i = 0; i < battleModule.matchInfo.players.Count; i++) { MatchPlayer matchPlayer = battleModule.matchInfo.players[i]; if (matchPlayer.playerUid == battleModule.playerUID) { var ancestryType = (GameObjectTool.AncestryType)ModelComTools.Config.GetAncestryByID(matchPlayer.horse.modelId).Type; GameObjectTool.LoadHorseIconByHorseClothes(uiData.tf_CombatLeftHead, matchPlayer.horse.clothesModel, ancestryType); uiData.tf_CombatLeftName.text = matchPlayer.horse.name; //uiData.image_CombatLeftHeadImg.sprite = GameObjectTool.LoadHorseIcon(matchPlayer.horse.skin); } else { var ancestryType = (GameObjectTool.AncestryType)ModelComTools.Config.GetAncestryByID(matchPlayer.horse.modelId).Type; GameObjectTool.LoadHorseIconByHorseClothes(uiData.tf_CombatRightHead, matchPlayer.horse.clothesModel, ancestryType); uiData.tf_CombatRightName.text = matchPlayer.horse.name; //uiData.image_CombatRightHeadImg.sprite = GameObjectTool.LoadHorseIcon(matchPlayer.horse.skin); } } await ModelComTools.TimerComponent.WaitAsync(250); uiData.go_CombatVSNode.SetActive(true); await ModelComTools.TimerComponent.WaitAsync(1500); uiData.go_CombatNode.SetActive(false); }
public void Run(int horseId) { MatchModule matchModule = UtilsModuleManager.GetModule(ModuleType.MatchModule) as MatchModule; UIBattleMainComponent uiComponent = matchModule.uIBattleMainComponent; if (uiComponent != null) { var tips = GameObjectTool.GetLanguage(50138133); string skillInfo = string.Format(tips, horseId);//$"<color=#24f50a>{horseId}号赛马</color>:开始冲刺"; uiComponent.AddSkillInfo(skillInfo); } }
private void LongPress() { var currencyDefine = ModelComTools.Config.GetHorseSkillByID(skillId); if (currencyDefine != null) { //string showName = GameObjectTool.GetLanguage(currencyDefine.Name); string showDescribe = GameObjectTool.GetLanguage(currencyDefine.Describe); uiData.text_ExplainTxt.text = showDescribe; AlignScreen(); uiData.go_ExplainNode.SetActive(true); } }
/// <summary> /// 返回成年马的头像 /// </summary> /// <param name="modelId"></param> /// <returns></returns> public static Sprite LoadHorseIcon(int modelId) { var cfg = ModelComTools.Config; var dropType = GameObjectTool.GetPropIdType(modelId); //if (dropType == SceneTools.PropType.马匹血统) if (dropType == SceneTools.PropType.马匹皮肤) { //var ancestry = cfg.GetAncestryByID(modelId); var ancestry = cfg.GetHorseAncestrySkinByID(modelId); return(LoadSprite(ancestry.Head)); } else { Debug.LogError("参数 model id不在血统配置表id段内:" + modelId); return(null); } }
public void UpdateUIInfo(ETModel.Match.HorseRunData horsePar, float diWidthPar, float diHeightPar) { if (horsePar == null) { return; } horse = horsePar; diWidth = diWidthPar; diHeight = diHeightPar; bool isSelf = battleModule.isSelfPlayer(horse.playerUid); go_RankIconMy.SetActive(isSelf); image_RankIcon.sprite = GameObjectTool.LoadSprite("icon_hao" + (horse.Id + 1)); float yPos = -diHeight * (horse.PathId / 13f); recttrans.localPosition = new Vector3(0, yPos, 0); }
public void RefreshItem(ETModel.Match.HorseRunData horse)//排名变化时动态刷新Item显示 { this.horse = horse; //------------------------- //bool isFamousHorse = horse.horseName.Contains("famousHorse__"); //是否是名马 //string horseName = isFamousHorse? horse.horseName.Substring(13): horse.playerNickname; //Eris 2021_10_19_17:15 string horseName = horse.horseName; bool isSelf = battleModule.isSelfPlayer(horse.playerUid); matchItemData.image_Normal_iteminfo_bg.gameObject.SetActive(!isSelf); matchItemData.image_famousBg.gameObject.SetActive(isSelf); //if (isSelf) //{ // matchItemData.text_TextMatchItemRank_4.text = $"<color=#a7ff34>{horse.Rank + 1}</color>"; // matchItemData.text_TextMatchItemPlayer_6.text = $"<color=#a7ff34>{horseName}</color>"; //} //else //{ // matchItemData.text_TextMatchItemRank_4.text = $"<color=white>{horse.Rank + 1}</color>"; // matchItemData.text_TextMatchItemPlayer_6.text = $"<color=white>{horseName}</color>"; //} matchItemData.text_TextMatchItemPlayer_6.text = GameObjectTool.ShortenDisplayText(horseName, 15);//horseName; matchItemData.text_TextMatchItemRank_4.text = (horse.Rank + 1) + string.Empty; matchItemData.image_haoIcon.sprite = GameObjectTool.LoadSprite("icon_hao" + (horse.Id + 1)); //if (horse.Rank < 3) //{ // matchItemData.image_RankPic.enabled = true; // matchItemData.image_RankPic.sprite = GameObjectTool.LoadSprite("icon_Rank0" + horse.Rank); // matchItemData.text_TextMatchItemRank_4.enabled = false; //} //else //{ matchItemData.image_RankPic.enabled = true; matchItemData.text_TextMatchItemRank_4.enabled = true; // } matchItemData.text_TextMatchItemPower_7.text = horse.fightValue + string.Empty; UpdateItemSelect(); }
public void Run(int horseId, bool IsBursting) { MatchModule matchModule = UtilsModuleManager.GetModule(ModuleType.MatchModule) as MatchModule; UIBattleMainComponent uiComponent = matchModule.uIBattleMainComponent; if (uiComponent != null) { string skillInfo = ""; var start = GameObjectTool.GetLanguage(50138133); var stop = GameObjectTool.GetLanguage(50139205); if (IsBursting) { skillInfo = string.Format(start, horseId);// $"<color=#24f50a>{horseId}号赛马</color>:开始加速"; } else { skillInfo = string.Format(stop, horseId);//$"<color=#24f50a>{horseId}号赛马</color>:停止加速"; } uiComponent.AddSkillInfo(skillInfo); } }
public void Update() { tempTimeFrame++; if (tempTimeFrame >= updateTimeFrame) { tempTimeFrame = tempTimeFrame - updateTimeFrame; uiData.text_GameTimeText3_21.text = GameObjectTool.FormatSecond2Set(funcs.GetTime()); //var process = myRunData.Pos / endPos; //if (process > 1) // process = 1f; //uiData.slider_m_MatchProgress.value = (float)process; SetResidualDistance(); SetMyPosTo2D(); } //curCDTime = curCDTime + Time.deltaTime; //if(curCDTime >= cdTime) //{ // curCDTime = cdTime - curCDTime; // UpdateEnsureInfo(); //} }
public void SetDirInfo(string dir) { image_DirPic.sprite = GameObjectTool.LoadSprite(dir); }
public void SetStateInfo(string state) { image_DiPic.sprite = GameObjectTool.LoadSprite(state); }
public void Run(int horseId, int skillId, bool isRemove) { //GameRunMatchComponent gameRunMatchComponent = Game.Scene.GetComponent<GameRunMatchComponent>(); //if (gameRunMatchComponent == null || gameRunMatchComponent.IsDisposed) // return; MatchModule matchModule = UtilsModuleManager.GetModule(ModuleType.MatchModule) as MatchModule; ModelHorseView findHorseView = matchModule.ModelHorseViewSet.Find(x => x.data.Id == horseId); //HorseView findHorseView = gameRunMatchComponent.GetHorseView(horseId); if (findHorseView == null) { Log.Error("没有这个马匹:" + horseId); return; } HorseSkillDefine horseSkillDefine = ModelComTools.Config.GetHorseSkillByID(skillId); if (horseSkillDefine == null) { Log.Error("没有这个技能:" + skillId); return; } List <int> skills = new List <int> { 50080040, 50080041, 50080042, 50080043, 50080044, 50080045, 50080046, 50080047, 50080048, 50080049, 50080050, 50080051, 50080052, 50080053, 50080054, 50080055, 50080056, 50080057, 50080058, 50080059, 50080060, 50080061, 50080062, 50080063, 50080064, 50080065, 50080066, 50080067, 50080068, 50080069, 50080070 }; if (skills.Contains(horseSkillDefine.Name)) { return; } string skillName = GameObjectTool.GetLanguage(horseSkillDefine.Name); string skillDesc = GameObjectTool.GetLanguage(horseSkillDefine.Describe); UIBattleMainComponent uiComponent = matchModule.uIBattleMainComponent; if (uiComponent != null) { var tips = GameObjectTool.GetLanguage(50138126); //触发 var tips1 = GameObjectTool.GetLanguage(50138127); //结束 string skillInfo = string.Format(tips, horseId + 1, skillName); // $"<color=#24f50a>{horseId + 1}号赛马</color>:触发{skillName}技能";//,{skillDesc}"; if (isRemove) { skillInfo = string.Format(tips1, horseId + 1, skillName);//$"<color=#24f50a>{horseId + 1}号赛马</color>:技能{skillName}结束"; } else { if (horseSkillDefine.ExistTime > 0) { TimeCountDownComponent TimeCountDownComponentSkill = ComponentFactory.Create <TimeCountDownComponent>(); TimeCountDownComponentSkill.Init(horseSkillDefine.ExistTime, null, string.Empty, () => { skillInfo = string.Format(tips1, horseId + 1, skillName);//$"<color=#24f50a>{horseId + 1}号赛马</color>:技能{skillName}结束"; uiComponent.AddSkillInfo(skillInfo); TimeCountDownComponentSkill.Dispose(); }); } } uiComponent.AddSkillInfo(skillInfo); if (findHorseView.data.playerUid == matchModule.playerUID) { uiComponent.SetSelfSkill(skillName, isRemove, skillId, horseSkillDefine.ExistTime); } } }