Exemple #1
0
    public override void Execute(GameObject gameObject)
    {
        AT_Enemy enemy = gameObject.GetComponent <AT_Enemy>();

        if (enemy.IsTargetWithinAttackDistance())
        {
            StopCoroutine(Chase(enemy));
            enemy.GetAgent().velocity  = Vector3.zero;
            enemy.GetAgent().isStopped = true;
            enemy.GetStateMachine().SetState(AttackState.Instance);
        }
        else
        {
            enemy.MoveTowardsTargetPosition();
        }
    }
Exemple #2
0
    public override void OnStatetEnter(GameObject gameObject)
    {
        AT_Enemy enemy = gameObject.GetComponent <AT_Enemy>();

        enemy.MyAnimator.SetBool("Walking", true);
        enemy.GetAgent().isStopped = false;
        //StartCoroutine(Chase(enemy));
    }