void Awake() { if (_instance != null) { if (_instance != this) { Debug.Log("There can be only one"); Destroy(gameObject); } } else { Debug.Log("First initialisation of manager"); _instance = this; DontDestroyOnLoad(gameObject); } }
public void Die() { HighwynnGameManager.Instance().ResetPlayerToLastCheckpoint(); lives = lives - 1; health = maxHealth; float calc_health = health / maxHealth; SetHealth(calc_health); if (lives == 0) { // Destroy (GameObject.FindWithTag("Player")); Time.timeScale = 0; Debug.Log("GAMEOVER"); gameOverPanel.SetActive(true); } }
private void Save() { //Destroy(gameObject); HighwynnGameManager.Instance().SetCheckpoint(gameObject); }
public void restartScene() { //SceneManager.LoadScene ("Scene01"); HighwynnGameManager.Instance().ResetPlayerToLastCheckpoint(); }