public void showScores() { StaticLevelState.changeState(3); if (!System.IO.File.Exists(Application.persistentDataPath + "/scores")) { scores = new Scores(); } else { scores = FileManager.ReadFromBinaryFile <Scores> (Application.persistentDataPath + "/scores"); } scoresPanel.SetActive(true); for (int i = 0; i < scores.getScores().Count; i++) { namesText.text += scores.getScores() [i].Key + "\r\n"; } for (int i = 0; i < scores.getScores().Count; i++) { scoresText.text += scores.getScores()[i].Value.ToString("0.00") + "m" + "\r\n"; } FileManager.WriteToBinaryFile(Application.persistentDataPath + "/scores", scores); }
public void killPlayer() { Health = 0; isDead = true; playerCurrentSpeed = 0f; setPlayerHorizontalSpeed(0); anim.SetTrigger("dead"); //Debug.Log("die"); SoundController.instance.stopMusic(); SoundController.instance.playMusic(music.player_death, false); // play dead animation StaticLevelState.changeState(2); }
public void showMenuWithoutRestart() { StaticLevelState.changeState(0); }
public void showMenu() { StaticLevelState.changeState(0); SceneManager.LoadScene("ImpossibleFeupPrototype"); }
public void startGame() { StaticLevelState.changeState(1); SoundController.instance.playMusic(music.bossfight_commando_steve, true); }
public void restartGame() { StaticLevelState.changeState(1); SceneManager.LoadScene("ImpossibleFeupPrototype"); }