Initial progress syncing + many existing bugs
This commit is contained in:
@@ -55,17 +55,17 @@ namespace Marro.PacManUdon
|
||||
private bool kinematic;
|
||||
|
||||
// This should be called once when the game is initialized
|
||||
public void Initialize(GameObject[] ghostTargets, PacMan pacMan, GameManager gameController)
|
||||
public void Initialize(Transform[] ghostTargets, PacMan pacMan, GameManager gameController)
|
||||
{
|
||||
this.gameController = gameController;
|
||||
ghosts = transform.GetComponentsInChildren<Ghost>(true);
|
||||
blinky = ghosts[0];
|
||||
for (int ghostIndex = 0; ghostIndex < ghosts.Length; ghostIndex++)
|
||||
{
|
||||
Vector2 homePosition = ghostTargets[0].transform.localPosition;
|
||||
Vector2 idlePosition1 = ghostTargets[1 + ghostIndex * 3].transform.localPosition;
|
||||
Vector2 idlePosition2 = ghostTargets[2 + ghostIndex * 3].transform.localPosition;
|
||||
Vector2 cornerPosition = ghostTargets[3 + ghostIndex * 3].transform.localPosition;
|
||||
Vector2 homePosition = ghostTargets[0].localPosition;
|
||||
Vector2 idlePosition1 = ghostTargets[1 + ghostIndex * 3].localPosition;
|
||||
Vector2 idlePosition2 = ghostTargets[2 + ghostIndex * 3].localPosition;
|
||||
Vector2 cornerPosition = ghostTargets[3 + ghostIndex * 3].localPosition;
|
||||
|
||||
ghosts[ghostIndex].Initialize(pacMan, blinky, homePosition, idlePosition1, idlePosition2, cornerPosition);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user