Esempio n. 1
0
 void Awake()
 {
     gameOverCanvas.SetActive(false);
     playerHealth  = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerHealth>();
     OnLifeUpdate += LivesUpdate;
     lifeText.text = string.Format("Lives: {0}", lives);
 }
Esempio n. 2
0
    void Start()
    {
        if (_updateLives != null)
        {
            GameObject.Destroy(_updateLives);
        }
        else
        {
            _updateLives = this;
        }

        DontDestroyOnLoad(this);

        currentLives = 3;
        for (int i = 0; i < Hearts.Length; i++)
        {
            Hearts[i].SetActive(true);
        }
    }
 private void Awake()
 {
     onUpdateCherries += UpdateCherryText;
     OnUpdateLives    += UpdateHeartsGrid;
     LoadPlayer();
 }