You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
DownloadTextureAsync does not returned the cached item if was previously downloaded. If the file exists locally, it is not returned.
To Reproduce
Use DownloadTextureAsync to download a texture
Call DownloadTextureAsync a second time to download it again
check downloads
Expected behavior
The cached item should be returned and a web call to download it again should not happen.
Actual behavior
Texture is downloaded again
Additional context
This is where the fault lies
if(url.Contains("file://")){isCached=true;cachePath=url;}else{isCached=TryGetDownloadCacheItem(fileName,outcachePath,downloadLocation,ForceDownload||downloadTextureArgs.ForceDownload);}usingvarwebRequest=UnityWebRequestTexture.GetTexture(url);varresponse=awaitProcessRequestAsync(webRequest,downloadTextureArgs);<--downloads again even though file exists
if(!response.Successful){Debug.LogError(GenerateErrorMessage("texture",url,response));returnnull;}vardownloadHandler=(DownloadHandlerTexture)webRequest.downloadHandler;
This should be used BEFORE the web call
if(isCached){url=cachePath;}
TO run the web call to load the file bytes locally
The text was updated successfully, but these errors were encountered:
Reality Collective - Utilities Bug Report
Describe the bug
DownloadTextureAsync does not returned the cached item if was previously downloaded. If the file exists locally, it is not returned.
To Reproduce
Expected behavior
The cached item should be returned and a web call to download it again should not happen.
Actual behavior
Texture is downloaded again
Additional context
This is where the fault lies
This should be used BEFORE the web call
TO run the web call to load the file bytes locally
The text was updated successfully, but these errors were encountered: