Exemplo n.º 1
0
 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;
     }
 }
Exemplo n.º 2
0
 public void TakeDamage(int damage)
 {
     healthSystem.TakeDamage(damage);
     StartCoroutine(flash());
     health.SetHealth(healthSystem.GetCurrentHealth());
 }
Exemplo n.º 3
0
 public void UpdateHealthBar()
 {
     health.SetHealth(healthSystem.GetCurrentHealth());
 }