[Interactions] Pulver now swaps, slots and combines items

This commit is contained in:
Michal Pikulski
2025-09-04 14:24:28 +02:00
parent 0caf0d5209
commit 05a8a5445f
13 changed files with 612 additions and 4 deletions

View File

@@ -127,6 +127,15 @@ public class Pickup : MonoBehaviour
playerController.OnArrivedAtTarget += OnPlayerArrived;
playerController.OnMoveToCancelled += OnPlayerMoveCancelled;
Vector3 stopPoint = transform.position + (playerObj.transform.position - transform.position).normalized * playerStopDistance;
playerController.MoveToAndNotify(stopPoint);
float dist = Vector2.Distance(new Vector2(playerObj.transform.position.x, playerObj.transform.position.y), new Vector2(stopPoint.x, stopPoint.y));
if (dist <= 0.2f)
{
// Already within stop range, trigger arrival logic immediately
OnPlayerArrived();
}
else
{
playerController.MoveToAndNotify(stopPoint);
}
}
}