void attack()
{
if (target != null ) {
if (null==hit){
hit = GetComponentInChildren<Hitable>();
hit.keepAlive = true;
hit.hits = new System.Type[]{ typeof(PlayerCanon), typeof(MineralMiner), typeof(AutoCanon) };
hit.damage = damagePerLevel[level];
}
hit.enabled = true;
animator.SetTrigger("attack");
} else {
attacking = false;
CancelInvoke("attack");
hit.enabled = false;
}
}