public void TakeDamage(float dmg) { currentHealth -= dmg; healthBar.SetHealth(currentHealth); if (organic) { GameObject blood = Instantiate(bloodSplat, transform.position, Quaternion.identity); blood.transform.rotation = Quaternion.Euler(0, Random.Range(0, 360), 0); blood.transform.position -= Vector3.up * 0.06f; } }
public void TakeDamage(int damage) { healthSystem.TakeDamage(damage); StartCoroutine(flash()); health.SetHealth(healthSystem.GetCurrentHealth()); }
public void UpdateHealthBar() { health.SetHealth(healthSystem.GetCurrentHealth()); }