/// <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(); } }
private void MoveToLastKnownPos(GameObject obj) { _navAgent.SetDestination(_lastKnownPos); OnDestinationBegin?.Invoke(); }
/// <summary> /// Moves to our target /// </summary> private void MoveToTarget(GameObject obj) { _currentTarget = obj; _navAgent.SetDestination(obj.transform.position); OnDestinationBegin?.Invoke(); }