wip: Critical Path Blocking

This commit is contained in:
Alexandre Coirier
2026-05-20 23:05:52 +02:00
parent 55e19eb959
commit ce17cbbe8b
36 changed files with 4180 additions and 16 deletions
@@ -35,6 +35,12 @@ namespace OctoCore.Components
public PlayerModes Mode = PlayerModes.FirstPerson;
public Orientations Orientation = Orientations.Camera;
[Tooltip("Allow position movement.")]
public bool AllowMove = true;
[Tooltip("Allow looking around.")]
public bool AllowLook = true;
[Tooltip("Walk speed (km/h).")]
public float WalkSpeed = 10;
@@ -229,7 +235,7 @@ namespace OctoCore.Components
private void HandleMovement()
{
_moveInput = (State.IsPaused || !State.IsFocussed) ? Vector2.zero : Vector2.ClampMagnitude(_moveInput, 1);
_moveInput = (State.IsPaused || !State.IsFocussed || !_settings.AllowMove) ? Vector2.zero : Vector2.ClampMagnitude(_moveInput, 1);
Camera cam = (_firstPerson.Camera && _firstPerson.Camera.enabled && _firstPerson.Camera.gameObject.activeInHierarchy) ? _firstPerson.Camera : Camera.main;
bool accelerating = _moveInput.magnitude > .1f;
@@ -324,11 +330,14 @@ namespace OctoCore.Components
{
Vector2 delta = (State.IsPaused || !State.IsFocussed) ? Vector2.zero : _lookInput;
float mouseX = delta.x * _firstPerson.SensitivityX;
float mouseY = delta.y * _firstPerson.SensitivityY * -1;
if (_settings.AllowLook)
{
float mouseX = delta.x * _firstPerson.SensitivityX;
float mouseY = delta.y * _firstPerson.SensitivityY * -1;
State.Yaw += mouseX;
State.Pitch = Mathf.Clamp(State.Pitch + mouseY, _firstPerson.MinPitch, _firstPerson.MaxPitch);
State.Yaw += mouseX;
State.Pitch = Mathf.Clamp(State.Pitch + mouseY, _firstPerson.MinPitch, _firstPerson.MaxPitch);
}
if (State.Driver)
State.Driver.ApplyLookInfluence(State.Yaw, State.Pitch, Time.deltaTime, out State.Yaw, out State.Pitch);
@@ -100,7 +100,6 @@ namespace OctoCore.Components
void Start()
{
Debug.Log("Start");
_state.InitialPosition = transform.localPosition;
_state.InitialRotation = transform.localRotation;
_state.InitialScale = transform.localScale;