Fixed ghost blink
This commit is contained in:
@@ -501,12 +501,7 @@ namespace Marro.PacManUdon
|
||||
{
|
||||
SetAnimatorGhostType((int)PacManGhostType.Special);
|
||||
}
|
||||
else if (isScared)
|
||||
{
|
||||
|
||||
SetAnimatorGhostType((int)PacManGhostType.Scared);
|
||||
}
|
||||
else
|
||||
else if (!isScared)
|
||||
{
|
||||
switch (ghostState)
|
||||
{
|
||||
|
||||
@@ -94,7 +94,7 @@ namespace Marro.PacManUdon
|
||||
SetSharedPelletCounterActive(true);
|
||||
}
|
||||
|
||||
foreach (Ghost ghost in ghosts)
|
||||
foreach (var ghost in ghosts)
|
||||
{
|
||||
ghost.Reset();
|
||||
}
|
||||
@@ -176,7 +176,7 @@ namespace Marro.PacManUdon
|
||||
|
||||
for (int ghostIndex = 0; ghostIndex < ghosts.Length; ghostIndex++)
|
||||
{
|
||||
Ghost ghost = ghosts[ghostIndex];
|
||||
var ghost = ghosts[ghostIndex];
|
||||
if (ghost.GetGhostState() == PacManGhostState.Home)
|
||||
{
|
||||
ghost.Release();
|
||||
@@ -277,7 +277,7 @@ namespace Marro.PacManUdon
|
||||
void SetGhostBlinkingState(bool white)
|
||||
{
|
||||
blinkCurrentlyWhite = white;
|
||||
foreach (Ghost ghost in ghosts)
|
||||
foreach (var ghost in ghosts)
|
||||
{
|
||||
ghost.SetWhite(white);
|
||||
}
|
||||
@@ -292,7 +292,7 @@ namespace Marro.PacManUdon
|
||||
powerPelletCountdown = powerPelletDuration;
|
||||
powerPelletMultiplier = 0;
|
||||
SetGhostBlinking(false);
|
||||
foreach (Ghost ghost in ghosts)
|
||||
foreach (var ghost in ghosts)
|
||||
{
|
||||
ghost.BecomeScared();
|
||||
}
|
||||
@@ -310,7 +310,7 @@ namespace Marro.PacManUdon
|
||||
public void SetFrozen(bool frozen, bool ignoreIfCaught = false)
|
||||
{
|
||||
this.frozen = frozen;
|
||||
foreach (Ghost ghost in ghosts)
|
||||
foreach (var ghost in ghosts)
|
||||
{
|
||||
ghost.SetFrozen(frozen, ignoreIfCaught: ignoreIfCaught);
|
||||
}
|
||||
@@ -380,7 +380,7 @@ namespace Marro.PacManUdon
|
||||
void SetScattering(bool scattering, bool reverseDirection = true)
|
||||
{
|
||||
//Debug.Log($"{gameObject} SetScattering: {scattering}");
|
||||
foreach (Ghost ghost in ghosts)
|
||||
foreach (var ghost in ghosts)
|
||||
{
|
||||
if (ghost == blinky && elroyLevel > 0) // Once blinky is elroy he no longer scatters
|
||||
{
|
||||
@@ -398,7 +398,7 @@ namespace Marro.PacManUdon
|
||||
{
|
||||
//Debug.Log($"{gameObject} SetSharedPelletCounterActive {active}");
|
||||
sharedPelletCounterActive = active;
|
||||
foreach (Ghost ghost in ghosts)
|
||||
foreach (var ghost in ghosts)
|
||||
{
|
||||
ghost.SetHousePelletCounterActive(!active);
|
||||
}
|
||||
@@ -426,7 +426,7 @@ namespace Marro.PacManUdon
|
||||
//Debug.Log($"Incremented shared pellet counter to {sharedPelletCounter}");
|
||||
for (int ghostIndex = 0; ghostIndex < sharedPelletCounterReleaseValues.Length; ghostIndex++)
|
||||
{
|
||||
Ghost ghost = ghosts[ghostIndex];
|
||||
var ghost = ghosts[ghostIndex];
|
||||
if (ghost.GetGhostState() == PacManGhostState.Home && sharedPelletCounter == sharedPelletCounterReleaseValues[ghostIndex])
|
||||
{
|
||||
ghost.Release();
|
||||
@@ -443,7 +443,7 @@ namespace Marro.PacManUdon
|
||||
{
|
||||
for (int ghostIndex = 0; ghostIndex < ghosts.Length; ghostIndex++)
|
||||
{
|
||||
Ghost ghost = ghosts[ghostIndex];
|
||||
var ghost = ghosts[ghostIndex];
|
||||
if (ghost.GetGhostState() == PacManGhostState.Home)
|
||||
{
|
||||
ghost.IncrementHousePelletCounter();
|
||||
@@ -470,7 +470,7 @@ namespace Marro.PacManUdon
|
||||
public void SetActive(bool active)
|
||||
{
|
||||
gameObject.SetActive(active);
|
||||
foreach (Ghost ghost in ghosts)
|
||||
foreach (var ghost in ghosts)
|
||||
{
|
||||
ghost.SetActive(active);
|
||||
}
|
||||
@@ -479,7 +479,7 @@ namespace Marro.PacManUdon
|
||||
public void SetKinematic(bool kinematic)
|
||||
{
|
||||
this.kinematic = kinematic;
|
||||
foreach (Ghost ghost in ghosts)
|
||||
foreach (var ghost in ghosts)
|
||||
{
|
||||
ghost.SetKinematic(kinematic);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user