public override BTState Evaluate()
    {
        if (attackEvent != null)
        {
            myAI.IsIdle   = false;
            myAI.IsMoving = false;
            myAI.GetAnimator().SetBool("Idle", myAI.IsIdle);
            myAI.GetAnimator().SetBool("Attack", myAI.IsAttack);
            int nRandomDiceValue = Random.Range(nStartDiceValue, nStartDiceValue + nDiceRange);
            attackEvent(nRandomDiceValue);
        }

        return(BTState.SUCCESS);
    }
    public override BTState Evaluate()
    {
        if (myAI.GetAnimator().GetInteger("AttackState") == 0)
        {
            if (myAI.IsAttack)
            {
                return(BTState.SUCCESS);
            }
        }

        return(BTState.FAILURE);
    }
    public override BTState Evaluate()
    {
        if (myAI.IsIdle && !buffEnemyController.IsBuff)
        {
            myAI.IsIdle = false;
        }

        if (myAI.IsIdle && buffEnemyController.buffTarget != null && !buffEnemyController.buffTarget.gameObject.activeSelf)
        {
            myAI.IsIdle = false;
        }

        if (!myAI.IsIdle)
        {
            myAI.GetAnimator().SetBool("Idle", myAI.IsIdle);
            return(BTState.FAILURE);
        }

        myAI.IsIdle = true;
        myAI.GetAnimator().SetBool("Idle", myAI.IsIdle);
        return(BTState.SUCCESS);
    }
Esempio n. 4
0
    public override BTState Evaluate()
    {
        if (!myAI.IsAttack && !myAI.IsAttackDelay)
        {
            return(BTState.FAILURE);
        }

        if (myAI.IsIdle)
        {
            myAI.IsMoving = false;
            myAI.GetAnimator().SetBool("Move", myAI.IsMoving);
            return(BTState.SUCCESS);
        }

        return(BTState.FAILURE);
    }