// ATTACK
public void attack(AbstractEntity enemy, Vector3 enemyPos){
if(this.isAlive() && enemy.isAlive()){
this.lookAt (enemyPos);
if (timeForNextAction<=0){
if (animator.GetBool("attack_enabled")) animator.SetBool ("attack_enabled", false);
if (animator.GetBool("walk_enabled")) animator.SetBool ("walk_enabled", false);
if (!animator.GetBool("attack_enabled")) animator.SetBool ("attack_enabled", true);
PNJAudio.PlayOgreHit();
enemy.onAttackReceived (DMG);
timeForNextAction = timecost_perAction;
}
}else if (animator.GetBool("attack_enabled")){
animator.SetBool("attack_enabled",false);
}
}