update MUTIPLAY

This commit is contained in:
2026-04-05 00:08:43 +07:00
parent 95b94260ac
commit e6deb358df
13 changed files with 285 additions and 91 deletions

View File

@@ -20,12 +20,20 @@ namespace OnlyScove.Scripts
public string GroundedStatus => (stateMachine != null && stateMachine.IsGrounded) ? "YES" : "NO";
public float HorizontalSpeed => stateMachine != null ? new Vector3(stateMachine.Controller.velocity.x, 0, stateMachine.Controller.velocity.z).magnitude : 0f;
public float VerticalSpeed => stateMachine != null ? stateMachine.VelocityY : 0f;
public Vector2 MoveInput => stateMachine != null ? stateMachine.Input.MoveInput : Vector2.zero;
public bool IsSprinting => stateMachine != null ? stateMachine.Input.IsSprintHeld : false;
// Sửa lỗi truy cập InputReader từ StateMachine
public Vector2 MoveInput => (stateMachine != null && stateMachine.Input != null) ? stateMachine.Input.MoveInput : Vector2.zero;
public bool IsSprinting => (stateMachine != null && stateMachine.Input != null) ? stateMachine.Input.IsSprintHeld : false;
public string TargetInteractable => stateMachine != null ? (stateMachine.GetInteractable()?.InteractionPrompt ?? "None") : "N/A";
public IInteractable GetActiveInteractable() => stateMachine?.GetInteractable();
public Vector3 GetInteractionPoint() => stateMachine != null ? stateMachine.Scanner.GetLastInteractionPoint(stateMachine.InteractionRange, stateMachine.InteractionMask) : Vector3.zero;
public Vector3 GetInteractionPoint()
{
if (stateMachine == null || stateMachine.Scanner == null) return Vector3.zero;
return stateMachine.Scanner.GetLastInteractionPoint(stateMachine.InteractionRange, stateMachine.InteractionMask);
}
private Vector3 currentVelocity;
private Transform cameraTransform;