Esempio n. 1
0
 public void TakeDmg(float dmg)
 {
     if (health > 0)
     {
         health -= dmg;
         Popup.Create(transform.position, (int)dmg, GameAssets.instance.damagePopup);
         healthBar.ChangeSize(maxHealth, health);
         if (health <= 0)
         {
             kill();
         }
     }
 }
Esempio n. 2
0
 private void Start()
 {
     healthBar.ChangeSize(playerStats.health, playerStats.currentHealth);
     camera = Camera.main;
 }