I download a GameObject(FBX format)
from the Url and save as a byte[]
. After saving, I can not access the file on Android and I want to convert it to GameObject
after downloading from the byte.
Also Resources.Load
not working!
This is my code snippet:
IEnumerator DownloadFBX()
{
using (var webRequest = UnityWebRequest.Get(Url))
{
yield return webRequest.SendWebRequest();
if (webRequest.isNetworkError)
{
Debug.LogError(webRequest.error);
}
else
{
File.WriteAllBytes(Path.Combine(Application.persistentDataPath + "/Resources/", "Handgun.fbx"), webRequest.downloadHandler.data);
// Now I want create GameObject from byte[]. Resources.Load not working !
}
}
}