Some Nice UI
This commit is contained in:
@@ -17,6 +17,8 @@ public class PlayerPlatformerController : MonoBehaviour
|
||||
[SerializeField] private LayerMask groundMask = ~0;
|
||||
[SerializeField] private float groundCheckDistance = 0.05f;
|
||||
|
||||
private PlayerStressController playerStressController;
|
||||
|
||||
private Rigidbody2D body;
|
||||
private BoxCollider2D bodyCollider;
|
||||
private InputActionAsset runtimeActions;
|
||||
@@ -29,6 +31,7 @@ public class PlayerPlatformerController : MonoBehaviour
|
||||
{
|
||||
body = GetComponent<Rigidbody2D>();
|
||||
bodyCollider = GetComponent<BoxCollider2D>();
|
||||
playerStressController = GetComponent<PlayerStressController>();
|
||||
}
|
||||
|
||||
private void OnEnable()
|
||||
@@ -86,6 +89,8 @@ public class PlayerPlatformerController : MonoBehaviour
|
||||
return;
|
||||
}
|
||||
|
||||
if (playerStressController.isPanicking) return;
|
||||
|
||||
var input = moveAction.ReadValue<Vector2>();
|
||||
if (Mathf.Abs(input.x) > 0.01f)
|
||||
{
|
||||
@@ -98,6 +103,8 @@ public class PlayerPlatformerController : MonoBehaviour
|
||||
|
||||
private void OnJumpPerformed(InputAction.CallbackContext context)
|
||||
{
|
||||
if (playerStressController.isPanicking) return;
|
||||
|
||||
if (!IsGrounded())
|
||||
{
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user