예제 #1
0
        private void switchToNextPosition()
        {
            LocomotionActionEvent locomotionActionEvent = positionTimeline.Dequeue();
            LocomotionController  currentController     = locomotionTracker.GetCurrentController();
            Vector3 vector       = ((currentController != null) ? currentController.GetPosition() : base.transform.position);
            Vector3 wsSteerInput = locomotionActionEvent.Position - vector;

            wsSteerInput.y = 0f;
            if (locomotionActionEvent.Direction.HasValue)
            {
                wsSteerInput = locomotionActionEvent.Direction.Value;
                if (locomotionActionEvent.Type.IsMovement())
                {
                    lastStickDirection = wsSteerInput;
                }
            }
            if (currentController != null && !(currentController is SlideController))
            {
                if (locomotionActionEvent.Type.IsMovement())
                {
                    currentController.Steer(wsSteerInput);
                }
                else if (locomotionActionEvent.Type == LocomotionAction.Rotate)
                {
                    currentController.SteerRotation(wsSteerInput);
                }
            }
            desiredStartEvent  = desiredTargetEvent;
            desiredTargetEvent = locomotionActionEvent;
            startPosition      = vector;
            startFacing        = ((currentController != null) ? currentController.GetFacing() : base.transform.forward);
            state = SyncState.INTERPOLATION;
        }