Exemple #1
0
 public void AttackHero(float damage)
 {
     if (Player != null)
     {
         HeroController hc = Player.GetComponent <HeroController>();
         if (hc != null)
         {
             hc.GetHit(damage);
         }
     }
 }
Exemple #2
0
 void OnTriggerStay2D(Collider2D other)
 {
     if (spriteRenderer.color.a >= 1.0f)
     {
         HeroController hc = other.GetComponent <HeroController>();
         if (hc != null)
         {
             hc.GetHit();
         }
     }
 }