Separated time sequences
This commit is contained in:
50
Assets/Scripts/Sequences/PacManCaught.cs
Normal file
50
Assets/Scripts/Sequences/PacManCaught.cs
Normal file
@@ -0,0 +1,50 @@
|
||||
namespace Marro.PacManUdon
|
||||
{
|
||||
public partial class GameManager
|
||||
{
|
||||
private void TimeSequenceStepPacManCaught(int sequenceProgress)
|
||||
{
|
||||
switch (sequenceProgress)
|
||||
{
|
||||
case 0:
|
||||
// Freeze (except for the ghost animations)
|
||||
SetFrozen(true, ghostKeepAnimating: true);
|
||||
soundManager.StopAllSound();
|
||||
break;
|
||||
case 1:
|
||||
// Hide ghosts, start pacman death animation
|
||||
SetGhostsActive(false);
|
||||
pacMan.SetDead(true);
|
||||
break;
|
||||
case 2:
|
||||
// Start playing death sound
|
||||
soundManager.PlayDeathSound();
|
||||
break;
|
||||
case 3:
|
||||
// Hide pacman, start next state
|
||||
SetPacManActive(false);
|
||||
if (gameState == PacManGameState.AttractModeDemo)
|
||||
{
|
||||
break;
|
||||
}
|
||||
if (extraLives > 0)
|
||||
{
|
||||
InsertTimeSequence(PacManTimeSequence.RestartLevel);
|
||||
break;
|
||||
}
|
||||
|
||||
InsertTimeSequence(PacManTimeSequence.GameOver);
|
||||
break;
|
||||
case 4:
|
||||
if (gameState == PacManGameState.AttractModeDemo)
|
||||
{
|
||||
#if RECORDING_DEMO
|
||||
// recorder.gameObject.SetActive(false);
|
||||
#endif
|
||||
InsertTimeSequence(PacManTimeSequence.AttractScreenIntroduction);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user