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