Added back api call for getting English names

removed downloaded text caching?
This commit is contained in:
katboi01
2022-11-08 11:21:35 +01:00
parent 962a366da5
commit 5215cd2801
2 changed files with 25 additions and 17 deletions
+7 -15
View File
@@ -7,25 +7,17 @@ public class UmaViewerDownload : MonoBehaviour
{
public static IEnumerator DownloadText(string url, System.Action<string> callback)
{
if (PlayerPrefs.GetString(url, "")=="")
{
UnityWebRequest www = UnityWebRequest.Get(url);
yield return www.SendWebRequest();
UnityWebRequest www = UnityWebRequest.Get(url);
yield return www.SendWebRequest();
if (www.result != UnityWebRequest.Result.Success)
{
Debug.Log(www.error);
}
else
{
PlayerPrefs.SetString(url, www.downloadHandler.text);
callback(www.downloadHandler.text);
}
if (www.result != UnityWebRequest.Result.Success)
{
Debug.Log(www.error);
callback("");
}
else
{
callback(PlayerPrefs.GetString(url, ""));
callback(www.downloadHandler.text);
}
}
}