I followed guides here: Unity - Manual: App thinning
and successfully collected ODR, made build and uploaded it to TestFlight which shows correct number of our On Demand Resources.
When we run the game, downloading ODR works, but when we try to get path to the resource inside, it always returns empty string.
Code that downloads and tries to get path:
OnDemandResourcesRequest request = OnDemandResources.PreloadAsync(new string[] { tag });
yield return request;
if (!string.IsNullOrEmpty(request.error))
{
Debug.Log($"Error in On Demand Request: {request.error}");
}
else
{
Debug.Log(request.GetResourcePath(resourceToSearch));
request.Dispose();
}
request.GetResourcePath(resourceToSearch) is always an empty string. What can I do to get path to the resource? Is there something I might be doing wrong?
I made sure tag and resourceToSearch are correct. I also tried typing resourceToSearch with and without extension.