Hey guys,
I am trying to load a folder full of images into an array with UnityWebRequest. I only know how to access a certain image. I want to load a folder dynamically and fill the array with the images afterwards. How would I do that? textureTest is the folder I put in the main asset folder within unity. Would it be hard if the folder is outside of unity? Do I need the Application.dataPath at all?
Thank you for your help.
Best regards!
IEnumerator GetCards()
{
using (UnityWebRequest cardRequest = UnityWebRequestTexture.GetTexture(Application.dataPath + "\textureTest"))
{
yield return cardRequest.SendWebRequest();
if (cardRequest.isNetworkError || cardRequest.isHttpError)
{
print(cardRequest.error);
}
else
{
// Get downloaded asset bundle
var texture = DownloadHandlerTexture.GetContent(cardRequest);
}
}
}