Exemplo n.º 1
0
        protected virtual void OnMove(Vector2 input, bool running)
        {
            var cam = CameraManager.Mode as IRotatableCamera;

            if (input.magnitude > 0 && cam is IPerspectiveCamera)
            {
                var speed = Locomotion.RotateTowards(Vector3.up, cam.Heading);

                cam.Heading -= speed * Time.deltaTime;
            }

            var movement = input.normalized;

            Locomotion.Move(new Vector3(movement.x, 0, movement.y));

            if (running && Locomotion.Pacing != RunningPace)
            {
                Locomotion.Pacing = RunningPace;
            }

            if (!running && Locomotion.Pacing == RunningPace)
            {
                Locomotion.Pacing = WalkingPace;
            }
        }