Пример #1
0
 private void OnTriggerStay2D(Collider2D other)
 {
     if (other.gameObject.name == "Fire" && currentCooldown <= 0)
     {
         hc.Hurt();
         currentCooldown = damageCooldown;
     }
 }
Пример #2
0
 public void DoDamage(int attack)
 {
     healthComponent.Hurt(attack);
     animator.SetTrigger("hurt");
     audioSource.clip = hurtClip;
     audioSource.Play();
 }
Пример #3
0
 private void OnTriggerStay2D(Collider2D other)
 {
     if (other.gameObject.name.Contains("Fire") && currentCooldown <= 0)
     {
         healthComponent.Hurt();
         currentCooldown = damageCooldown;
     }
 }
Пример #4
0
 private void OnTriggerEnter2D(Collider2D other)
 {
     if (other.gameObject.name == "Player")
     {
         HealthComponent hc = other.gameObject.GetComponent <HealthComponent>();
         hc.Hurt();
         SFXHelper.PlayEffect(SFXs.ReceiveDamage);
     }
 }