private void OnTriggerEnter2D(Collider2D other) { IStun stunEnemy = other.gameObject.GetComponent <Enemy>(); if (stunEnemy != null) { stunEnemy.StunAttack(); gameObject.SetActive(false); } }
static HitStruct PowerHit(IDealsDamage Power, IHealth Target) { HitStruct Hit = Power.GetDamage(); Target.Health -= Hit.HealthDamage; IStun StunTarget = Target as IStun; if (StunTarget != null) { StunTarget.Stun -= Hit.StunDamage; } return(Hit); }