예제 #1
0
 /// <summary>
 /// I heard a noise, let's move to the source of that noise.
 /// </summary>
 /// <param name="other"></param>
 private void MoveToAudible(GameObject obj)
 {
     if (_navAgent.enabled == true)
     {
         _navAgent.SetDestination(obj.transform.position);
         _currentTarget = obj;
         _lastKnownPos  = obj.transform.position;
         OnDestinationBegin?.Invoke();
     }
 }
예제 #2
0
 private void MoveToLastKnownPos(GameObject obj)
 {
     _navAgent.SetDestination(_lastKnownPos);
     OnDestinationBegin?.Invoke();
 }
예제 #3
0
 /// <summary>
 /// Moves to our target
 /// </summary>
 private void MoveToTarget(GameObject obj)
 {
     _currentTarget = obj;
     _navAgent.SetDestination(obj.transform.position);
     OnDestinationBegin?.Invoke();
 }