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);
        }
    }
Пример #2
0
    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);
        }
    }
Пример #3
0
 private void Save()
 {
     //Destroy(gameObject);
     HighwynnGameManager.Instance().SetCheckpoint(gameObject);
 }
Пример #4
0
 public void restartScene()
 {
     //SceneManager.LoadScene ("Scene01");
     HighwynnGameManager.Instance().ResetPlayerToLastCheckpoint();
 }