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(); } } }
private void Start() { healthBar.ChangeSize(playerStats.health, playerStats.currentHealth); camera = Camera.main; }