Some Nice UI
This commit is contained in:
@@ -23,14 +23,17 @@ public class PlayerPickupController : MonoBehaviour
|
||||
public Transform holdPoint; // Empty GameObject above head
|
||||
public float pickupRange = 2.0f;
|
||||
|
||||
private GameObject heldObject;
|
||||
public GameObject heldObject;
|
||||
private PlayerPlatformerController platformerController;
|
||||
private PlayerStressController playerStressController;
|
||||
private bool isChargingThrow;
|
||||
private float throwChargeStartTime;
|
||||
|
||||
private void OnEnable()
|
||||
{
|
||||
platformerController = GetComponent<PlayerPlatformerController>();
|
||||
playerStressController = GetComponent<PlayerStressController>();
|
||||
|
||||
if (inputActions == null)
|
||||
{
|
||||
Debug.LogError("PlayerPickupController missing InputActionAsset reference.", this);
|
||||
@@ -76,10 +79,10 @@ public class PlayerPickupController : MonoBehaviour
|
||||
|
||||
private void OnInteractPerformed(InputAction.CallbackContext context)
|
||||
{
|
||||
Debug.Log("Interact action performed");
|
||||
if(heldObject != null)
|
||||
if (playerStressController.isPanicking) return;
|
||||
|
||||
if (heldObject != null)
|
||||
{
|
||||
Debug.Log("Dropping held object");
|
||||
DropObject(false);
|
||||
return;
|
||||
}
|
||||
@@ -94,6 +97,12 @@ public class PlayerPickupController : MonoBehaviour
|
||||
return;
|
||||
}
|
||||
|
||||
if(playerStressController.isPanicking)
|
||||
{
|
||||
DropObject(false);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!heldObject.TryGetComponent<TrickController>(out _))
|
||||
{
|
||||
return;
|
||||
@@ -118,13 +127,15 @@ public class PlayerPickupController : MonoBehaviour
|
||||
{
|
||||
DropObject(true);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
void TryPickUp()
|
||||
{
|
||||
// Find all colliders within range
|
||||
Collider2D[] colliders = Physics2D.OverlapCircleAll(transform.position, pickupRange);
|
||||
Debug.Log(colliders.Length + " colliders found in range");
|
||||
|
||||
foreach (var col in colliders)
|
||||
{
|
||||
if (col.gameObject == gameObject)
|
||||
|
||||
Reference in New Issue
Block a user