public override void Run(string parm) { if (int.TryParse(parm, out int cameraHorseID)) { MatchModule matchModule = UtilsModuleManager.GetModule(ModuleType.MatchModule) as MatchModule; ModelHorseView findHorseView = matchModule.ModelHorseViewSet.Find(x => x.data.Id == cameraHorseID); //gameRunMatchComponent.GetHorseView(cameraHorseID); GameRunRealCameraComponent gameRunRealCameraComponent = Game.Scene.GetComponent <GameRunRealCameraComponent>(); if (gameRunRealCameraComponent != null) { gameRunRealCameraComponent.currHorseView = findHorseView; } } }
public void DoNewUpdate() { if (m_bIsStartLastPlayerFocus) { MatchModule matchModule = UtilsModuleManager.GetModule(ModuleType.MatchModule) as MatchModule; if (matchModule != null && matchModule.matchInit != null && !matchModule.matchInit.isGameEnd) { int _allPlayersCount = matchModule.matchInit.funcs.GetHorses().Count; int _lastPlayerID = matchModule.matchInit.funcs.GetCurrRanks()[_allPlayersCount - 1]; ModelHorseView _lastHorseView = matchModule.HorseRunDataID2ModelHorseViewSet[_lastPlayerID]; Transform _paramLast = _lastHorseView.GetCloseUpCameraRelativeParam(); FeatureCameraTrans.position = _paramLast.position;// + (FeatureCameraTrans.forward * -1) * 5 * tt / during; FeatureCameraTrans.rotation = _paramLast.rotation; } } }
private void ShowHeadPlayerNameAndHorseName(int horseIdx) { ETModel.Match.HorseRunData horseRunData = horseList[horseIdx]; //马头上排名显示 ModelHorseView findHorseView = battleModule.HorseRunDataID2ModelHorseViewSet[horseRunData.Id]; if (findHorseView == null) { return; } RankingInSceneTemplateData rankData = horseHeadList[horseIdx]; if (rankData == null || rankData.transform == null) { return; } bool isSelectHorse = (battleModule.currCameraHorseId == horseRunData.Id); bool isMy = (horseRunData.playerUid == myPlayerUID); if (rankData.image_SelectFlag.gameObject.activeInHierarchy != isSelectHorse) { rankData.image_SelectFlag.gameObject.SetActive(isSelectHorse); } if (rankData.text_TextPlayerName.gameObject.activeInHierarchy != battleModule.isOpenHead) { rankData.text_TextPlayerName.gameObject.SetActive(battleModule.isOpenHead); rankData.text_TextHorseName.gameObject.SetActive(battleModule.isOpenHead); } //设置PlayerName位置 Camera currCamera = gameRunRealCameraComponent.GetCurrRunCamera(); Vector3 screenPosPlayerName = currCamera.WorldToScreenPoint(findHorseView.PlayerNamePointTrans.position); Vector3 posUIPlayerName = battleModule.UICamera.ScreenToWorldPoint(screenPosPlayerName); Vector3 newPos = new Vector3(posUIPlayerName.x, posUIPlayerName.y + 0.4f, posUIPlayerName.z); rankData.image_SelectFlag.transform.position = newPos; if (battleModule.isOpenHead) { rankData.text_TextPlayerName.transform.position = posUIPlayerName; rankData.text_TextPlayerName.transform.localPosition = new Vector3(rankData.text_TextPlayerName.transform.localPosition.x, rankData.text_TextPlayerName.transform.localPosition.y, 0);//设置z坐标为0 } }
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); } } }
public void beginWinnerCameraShow() { isRunMotionCamera = false; //因为主要比赛系统的update限制不够灵活,所以采用下面较灵活的方式来做终点特写 //创建一个生命由时间控制的且具有lateupdate 或者 update功能的组件 SmartAutoComponent smartAuto = ComponentFactory.Create <SmartAutoComponent>(); OpenCurrCamera(FeatureCameraTrans); MatchModule matchModule = UtilsModuleManager.GetModule(ModuleType.MatchModule) as MatchModule; int winnerid = matchModule.matchInit.funcs.GetCurrRanks()[0]; ModelHorseView findHorseView = matchModule.HorseRunDataID2ModelHorseViewSet[winnerid]; Transform param = findHorseView.GetCloseUpCameraRelativeParam(); findHorseView.lockWinState(); float tt = 0; float during = 3;//4 void update() { tt += Time.deltaTime; //跟随第一匹马,冠军特写 if (param != null && FeatureCameraTrans != null) { FeatureCameraTrans.position = param.position + (FeatureCameraTrans.forward * -1) * 5 * tt / during; FeatureCameraTrans.rotation = param.rotation; } //isRunMotionCamera = false; } void onComplete() { //镜头给到最后一名 //if (!matchModule.matchInit.isGameEnd) //{ // m_bIsStartLastPlayerFocus = true; //} Game.EventSystem.Run(EventIdType.DisplayChampionFinished); } smartAuto.Init(during, update, onComplete); //Action onComplete2 = () => //{ // Game.EventSystem.Run(EventIdType.ReviewCrossLineFeature, String.Empty); //}; //Action onComplete = () => //{ // Log.Info("显示冠军的特写镜头完毕,现在该显示其他UI了"); // //jingchunlin 回放:将冲刺回放镜头替换为自己的 // //ETModel.Game.EventSystem.Run(ETModel.EventIdType.ReviewChongCiFeature, String.Empty); // //Game.EventSystem.Run(EventIdType.StopLoadAllHorsesData, String.Empty); // //Game.EventSystem.Run(EventIdType.ReviewCrossLineFeature, String.Empty); // //smartAuto.Init(1, update, onComplete2); //}; ////jingchunlin 注释:这段延时是为了等骑手挥舞动作结束 during改为了5 //smartAuto.Init(during, update, onComplete); //jingchunlin 回放:屏蔽掉一个停止拍摄的动作 //TimeCountDownComponent delayTime = ComponentFactory.Create<TimeCountDownComponent>(); //delayTime.Init(GameFeatureCameraMgr.output_Param.delayTimeAfterCrossFinish, () => //{ // ETModel.Game.EventSystem.Run(ETModel.EventIdType.QuestDisableChongCiFeatureCamera, String.Empty); //}); }