コード例 #1
0
        public static void doProgress(ActorMovingAction actionObject, float progress)
        {
            if (actionObject.ignoreTimeAction)
            {
                return;
            }

            ActorView entity = SceneViews.instance.getCurFBScene().getSceneEntity <ActorView>(actionObject.objectID);

            if (entity.startSamplePosition.HasValue)
            {
                if (entity.isRunState())
                {
                    var speed = (new Vector3(actionObject.targetPosition.x, 0.0f, actionObject.targetPosition.y) - entity.startSamplePosition.Value).magnitude * 60.0f;
                    entity.updateAnimtorSpeed(speed, actionObject.moveType);
                    entity.animator.SetFloat("moveType", (float)actionObject.moveType);
                    entity.showRunEffect();
                }
            }

            //获取本次移动位置
            Vector3 thisEndPostion = MovingProcessorUtility.getMovePosition(entity.startSamplePosition, actionObject.targetPosition, progress);

            entity.setPosition(thisEndPostion);
        }
コード例 #2
0
        public static void doProgress(BallMovingAction actionObject, float progress)
        {
            BallView entity = SceneViews.instance.getCurFBScene().ball;
            //获取本次移动位置
            Vector3 thisEndPostion = MovingProcessorUtility.getMovePosition(entity.startSamplePosition, actionObject.targetPosition, progress);

            entity.setPosition(thisEndPostion);
        }