first
This commit is contained in:
29
Runtime/FPPKit/Code/FPPActor.cs
Normal file
29
Runtime/FPPKit/Code/FPPActor.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user