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