I am trying to use async await from c# .net. It works fine in the editor but when I build it no longer work. It doesn’t break but the code doesn’t runs async
private async Task LoadModelAsync(string bundleName)
{
int versionToCheck = (versions.ContainsKey(bundleName)) ? versions[bundleName] : 0;
string path = "";
#if UNITY_IOS
path = "https://" + SERVER_URL + "/iOS/" + bundleName;
#elif UNITY_ANDROID
path = "https://" + SERVER_URL + "/Android/" + bundleName;
#endif
Debug.Log("Path: " + path);
UnityWebRequest www = new UnityWebRequest(path);
www.downloadHandler = new DownloadHandlerBuffer();
await www.SendWebRequest();
Debug.Log(www.isNetworkError);
Debug.Log(www.isHttpError);
Debug.Log(www.isDone);
Debug.Log(www.downloadHandler);
Debug.Log(www.downloadHandler.data);
AssetBundle assetBundle =
AssetBundle.LoadFromMemoryAsync(www.downloadHandler.data).assetBundle;
loadedBundles.Add(assetBundle);
// return bundle
if (OnBundleLoaded != null) OnBundleLoaded(assetBundle);
Debug.Log("Download complete and added to list");
}