broken
This commit is contained in:
@@ -1,29 +1,50 @@
|
||||
using RebootKit.Engine.Services.Simulation;
|
||||
using RebootKit.Engine.Services.Simulation.Characters;
|
||||
using RebootKit.Engine.Foundation;
|
||||
using RebootKit.Engine.Services.Simulation;
|
||||
using UnityEngine;
|
||||
using Logger = RebootKit.Engine.Foundation.Logger;
|
||||
|
||||
namespace RebootKit.FPPKit {
|
||||
public class FPPActor : Actor {
|
||||
[field: SerializeField]
|
||||
public CharacterLocomotion Locomotion { get; private set; }
|
||||
static readonly Logger s_logger = new(nameof(FPPActor));
|
||||
|
||||
[field: SerializeField]
|
||||
public FirstPersonCamera FPPCamera { get; private set; }
|
||||
// [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;
|
||||
|
||||
[field: SerializeField]
|
||||
public PhysicsObjectDragger Dragger { get; private set; }
|
||||
[SerializeField] HeroLocomotion m_Locomotion;
|
||||
[SerializeField] FPPCamera m_Camera;
|
||||
|
||||
[field: SerializeField]
|
||||
public float DragObjectDistanceFromCamera { get; private set; } = 2.0f;
|
||||
[SerializeField] PhysicsObjectDragger m_PhysicsDragger;
|
||||
[SerializeField] FloatRange m_DragDistanceRange = new(1.0f, 5.0f);
|
||||
|
||||
void Update() {
|
||||
m_PhysicsDragger.TargetWorldPosition = m_Camera.Camera.transform.position + m_Camera.transform.forward * 2.0f;
|
||||
}
|
||||
|
||||
public void Jump() {
|
||||
m_Locomotion.Jump();
|
||||
}
|
||||
|
||||
public void Look(Vector2 input) {
|
||||
m_Camera.Rotate(input.x, input.y);
|
||||
}
|
||||
|
||||
public void MoveRight(float input) {
|
||||
Vector3 direction = Quaternion.AngleAxis(FPPCamera.Yaw, Vector3.up) * Vector3.right;
|
||||
Locomotion.AddMovementInput(direction, input);
|
||||
Vector3 direction = Quaternion.AngleAxis(m_Camera.Yaw, Vector3.up) * Vector3.right;
|
||||
m_Locomotion.AddMovementInput(direction, input);
|
||||
}
|
||||
|
||||
public void MoveForward(float input) {
|
||||
Vector3 direction = Quaternion.AngleAxis(FPPCamera.Yaw, Vector3.up) * Vector3.forward;
|
||||
Locomotion.AddMovementInput(direction, input);
|
||||
Vector3 direction = Quaternion.AngleAxis(m_Camera.Yaw, Vector3.up) * Vector3.forward;
|
||||
m_Locomotion.AddMovementInput(direction, input);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user