Beispiel #1
0
    private bool Look(StateController controller)
    {
        float distance = Vector3.Distance(controller.chaseTarget.transform.position, controller.transform.position);

        if (distance <= controller.enemy.attackRange && controller.CheckAttackReady())
        {
            controller.enemy.isAttacking = true;
            controller.enemy.isWalking   = false;
            controller.enemy.startAttack();
            Debug.Log("attaking");
            return(true);
        }
        else
        {
            return(false);
        }
    }