Esempio n. 1
0
        private void camerMove()
        {
            SmartAutoComponent job = ComponentFactory.Create <SmartAutoComponent>();
            int   end       = funcs.GetEnd();
            float totalTime = 3 * 3;

            job.Init(totalTime,
                     () =>
            {
                Transform p = funcs.GetCameraPathParam(CameraPathState.State_GotWinner, end, end);
                if (p != null)
                {
                    FeatureCameraTrans.position = Vector3.Slerp(FeatureCameraTrans.position, p.position, Time.deltaTime / totalTime);
                    FeatureCameraTrans.rotation = Quaternion.Slerp(FeatureCameraTrans.rotation, p.rotation, Time.deltaTime / totalTime);
                }
            },
                     () =>
            {
                if (FeatureCameraTrans != null)
                {
                    FeatureCameraTrans.gameObject.SetActive(false);
                }
                if (PreCameraTrans != null)
                {
                    OpenCurrCamera(PreCameraTrans);
                }
            });
        }
Esempio n. 2
0
        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);
            //});
        }