29 lines
1.0 KiB
C#
29 lines
1.0 KiB
C#
using RebootKit.Engine.Services.Simulation;
|
|
using RebootKit.Engine.Services.Simulation.Characters;
|
|
using UnityEngine;
|
|
|
|
namespace RebootKit.FPPKit {
|
|
public class FPPActor : Actor {
|
|
[field: SerializeField]
|
|
public CharacterLocomotion Locomotion { get; private set; }
|
|
|
|
[field: SerializeField]
|
|
public FirstPersonCamera FPPCamera { get; private set; }
|
|
|
|
[field: SerializeField]
|
|
public PhysicsObjectDragger Dragger { get; private set; }
|
|
|
|
[field: SerializeField]
|
|
public float DragObjectDistanceFromCamera { get; private set; } = 2.0f;
|
|
|
|
public void MoveRight(float input) {
|
|
Vector3 direction = Quaternion.AngleAxis(FPPCamera.Yaw, Vector3.up) * Vector3.right;
|
|
Locomotion.AddMovementInput(direction, input);
|
|
}
|
|
|
|
public void MoveForward(float input) {
|
|
Vector3 direction = Quaternion.AngleAxis(FPPCamera.Yaw, Vector3.up) * Vector3.forward;
|
|
Locomotion.AddMovementInput(direction, input);
|
|
}
|
|
}
|
|
} |