void Update()
 {
     if (_playerUnit.GetComponent <Health>().CurrentHealth <= 0)
     {
         if (_playerUnit.playerLives > 0)
         {
             PlayerSpaceship player = SpawnPlayer();
             _playerUnit.GetComponent <Health>().IncreaseHealth(_playerUnit.GetComponent <Health>().MaximumHealth);
         }
     }
     SetHealthText();
 }
Exemplo n.º 2
0
        void Update()
        {
            // Setting the health text in the Update method.
            SetHealthText();

            if (_playerUnit.GetComponent <Health>().CurrentHealth <= 0)
            {
                if (_playerUnit.playerLives > 0)
                {
                    PlayerSpaceship player = SpawnPlayer();
                    _playerUnit.GetComponent <Health>().IncreaseHealth(_playerUnit.GetComponent <Health>().MaximumHealth);
                    Debug.Log("Totally spawned again, dude!");
                }
            }
        }