Renamed CollisionManager

This commit is contained in:
2026-06-18 11:03:56 +02:00
parent a7d1adf175
commit 64e445e8a6
21 changed files with 156 additions and 767 deletions

View File

@@ -11,7 +11,7 @@ namespace Marro.PacManUdon
private Ghost[] ghosts;
private Ghost blinky;
private PelletManager pelletManager;
private CollisionManager collisionManager;
// Level constants
private float speedDefault;
@@ -57,10 +57,10 @@ namespace Marro.PacManUdon
private bool frozen;
private bool kinematic;
public void Initialize(Transform[] ghostStarts, Transform[] ghostTargets, PacMan pacMan, PelletManager pelletManager, GameManager gameController)
public void Initialize(Transform[] ghostStarts, Transform[] ghostTargets, PacMan pacMan, CollisionManager collisionManager, GameManager gameController)
{
this.gameController = gameController;
this.pelletManager = pelletManager;
this.collisionManager = collisionManager;
ghosts = transform.GetComponentsInChildren<Ghost>(true);
blinky = ghosts[0];
@@ -72,7 +72,7 @@ namespace Marro.PacManUdon
Vector2 idlePosition2 = ghostTargets[2 + ghostIndex * 3].localPosition;
Vector2 cornerPosition = ghostTargets[3 + ghostIndex * 3].localPosition;
ghosts[ghostIndex].Initialize(pelletManager, pacMan, blinky, startTransform, homePosition, idlePosition1, idlePosition2, cornerPosition, ghostIndex);
ghosts[ghostIndex].Initialize(collisionManager, pacMan, blinky, startTransform, homePosition, idlePosition1, idlePosition2, cornerPosition, ghostIndex);
}
SubscribeToEvent(NetworkEventType.GhostUpdate);
@@ -105,7 +105,7 @@ namespace Marro.PacManUdon
public void NewLevel()
{
SetSharedPelletCounterActive(false);
UpdateElroyLevel(pelletManager.PelletCount);
UpdateElroyLevel(collisionManager.PelletCount);
foreach (Ghost ghost in ghosts)
{
ghost.ResetHousePelletCounter();