Bonus fruit hitbox

This commit is contained in:
2026-06-15 17:21:16 +02:00
parent c601dda10a
commit a24f237bd5
11 changed files with 439 additions and 294 deletions

View File

@@ -122,7 +122,7 @@ namespace Marro.PacManUdon
if (CrossesTileBorder(position, nextPosition, direction))
{
CheckNewTile(nextPosition);
CheckNewTile(position, nextPosition);
}
SetPosition(nextPosition);
@@ -212,9 +212,9 @@ namespace Marro.PacManUdon
return nextPosition;
}
private void CheckNewTile(Vector2 position)
private void CheckNewTile(Vector2 position, Vector2 nextPosition)
{
var pellet = pelletManager.CollectPelletAt(position);
var pellet = pelletManager.EatAtTile(position, nextPosition);
if (pellet == PelletType.Pellet)
{
@@ -341,14 +341,6 @@ namespace Marro.PacManUdon
UpdateAnimator();
}
void OnTriggerEnter(Collider other)
{
if (other.gameObject.GetComponent<BonusFruit>())
{
gameManager.GotFruit();
}
}
public override void CollectSyncedData(byte[] data, ref int index, NetworkEventType eventType)
{
if (eventType != NetworkEventType.PacManTurn)