void CheckMovingPossibility()
 {
     if (_enemyMaster.CurrentTarget == null && !_enemyMaster.isMoving && !_enemyMaster.isNavPaused)
     {
         if (IsRandomWanderTargetFound(_humanoidTransform.position, _wanderRange, out _wanderTarget))
         {
             _navMeshAgent.SetDestination(_wanderTarget);
             _enemyMaster.isMoving = true;
             _enemyMaster.CallOnAnimationsPlaying();
         }
     }
 }
Exemplo n.º 2
0
        void TryToChaseTarget()
        {
            if (_enemyMaster.CurrentTarget != null && _navMeshAgent != null && !_enemyMaster.isNavPaused)
            {
                _navMeshAgent.SetDestination(_enemyMaster.CurrentTarget.position);

                if (_navMeshAgent.remainingDistance > _navMeshAgent.stoppingDistance)
                {
                    _enemyMaster.isMoving = true;
                    _enemyMaster.CallOnAnimationsPlaying();
                }
            }
        }