Updated Audio and Scene along with bug fixes #285

Merged
glencelow merged 4 commits from PlayerController into main 2022-11-25 23:11:02 +08:00
7 changed files with 5 additions and 12 deletions
Showing only changes of commit fb512e7fc5 - Show all commits

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -59,6 +59,7 @@ public class Breakable : Script
} }
isBreak = false; isBreak = false;
Audio.PlaySFXOnce2D("event:/Props/impact_break");
Owner.SetActive(false); Owner.SetActive(false);
} }
} }

View File

@ -76,33 +76,25 @@ public class GameManager : Script
if(timeText) if(timeText)
timeText.GetComponent<TextRenderable>().Text = $"Time Left: {timer.ToString("0.00")}"; timeText.GetComponent<TextRenderable>().Text = $"Time Left: {timer.ToString("0.00")}";
if (timer > 0 && totalItemCount <= 0) if ((timer > 0 && totalItemCount <= 0) || Input.GetKeyDown(Input.KeyCode.F1))
{ {
currGameState = GameState.WIN; currGameState = GameState.WIN;
Audio.StopAllSounds(); Audio.StopAllSounds();
SceneManager.ChangeScene(winScene); SceneManager.ChangeScene(winScene);
Audio.PlaySFXOnce2D("event:/Music/stingers/game_win");
} }
else if(timer < 0) else if(timer < 0 || Input.GetKeyDown(Input.KeyCode.F2))
{ {
currGameState = GameState.LOSE; currGameState = GameState.LOSE;
Audio.StopAllSounds(); Audio.StopAllSounds();
SceneManager.ChangeScene(loseScene); SceneManager.ChangeScene(loseScene);
Audio.PlaySFXOnce2D("event:/Music/stingers/game_lose");
} }
} }
} }
private void Cheats() private void Cheats()
{ {
if (Input.GetKeyDown(Input.KeyCode.F1))
{
Audio.StopAllSounds();
SceneManager.ChangeScene(loseScene);
}
if (Input.GetKeyDown(Input.KeyCode.F2))
{
Audio.StopAllSounds();
SceneManager.ChangeScene(winScene);
}
if (Input.GetKeyDown(Input.KeyCode.Escape)) if (Input.GetKeyDown(Input.KeyCode.Escape))
{ {
Audio.StopAllSounds(); Audio.StopAllSounds();