/*==TESTING==>*/

    private void Awake()
    {
        navAgent   = GetComponent <NavMeshAgent>();
        animator   = GetComponentInChildren <Animator>();
        combatMgmt = GetComponent <NpcCombatManager>();

        navAgent.speed = walkSpeed;
        target         = GameObject.FindGameObjectWithTag("Player");
    }
Beispiel #2
0
    override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
    {
        combatManager                     = animator.transform.GetComponentInParent <NpcCombatManager>();
        npcCtrl                           = animator.transform.GetComponentInParent <NpcController>();
        npcCtrl.navAgent.velocity         = Vector3.zero;
        npcCtrl.navAgent.angularSpeed     = 300;
        npcCtrl.navAgent.stoppingDistance = combatManager.meleeAttackDistance;
        animator.SetBool("meleeAttackHold", false);

        randInt = Random.Range(0, 3);
    }