override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
    {
        BotUtility botUtility = animator.GetComponentInParent <BotUtility>();
        var        target     = botUtility.FindClosestPlayer();

        botUtility.Attack(target);
    }
Exemplo n.º 2
0
    public IEnumerator AttackEnemy()
    {
        var target = botUtility.FindClosestPlayer();

        if (botUtility.Attack(target))
        {
            yield return(new WaitForSeconds(1.0f));
        }
    }
    public override TaskStatus OnUpdate()
    {
        BotUtility botUtility = botObject.Value.GetComponent <BotUtility>();

        var target = botUtility.FindClosestPlayer();

        if (!botUtility.Attack(target))
        {
            return(TaskStatus.Failure);
        }

        return(TaskStatus.Success);
    }