Exemplo n.º 1
0
    public static IEnumerator MoveToInteractableSeq(this NavMeshAgent agent, Interactable interactable)
    {
        Vector3 targetPosition = interactable.GetComponent <Collider>().bounds.ClosestPoint(agent.transform.position);

        yield return(agent.MoveToPositionSeq(targetPosition));
    }