修复Unity5兼容报错的问题

This commit is contained in:
monitor1394
2020-11-21 08:41:52 +08:00
parent 68d21075f2
commit 5a384fbb89

View File

@@ -107,25 +107,41 @@ namespace XCharts
networkError = "";
var url = "https://raw.githubusercontent.com/monitor1394/unity-ugui-XCharts/master/Assets/XCharts/package.json";
var web = UnityWebRequest.Get(url);
#if UNITY_5
yield return web.Send();
#else
yield return web.SendWebRequest();
#endif
CheckVersionWebRequest(web);
if (isNetworkError)
{
url = "https://gitee.com/monitor1394/unity-ugui-XCharts/raw/master/Assets/XCharts/package.json";
web = UnityWebRequest.Get(url);
#if UNITY_5
yield return web.Send();
#else
yield return web.SendWebRequest();
#endif
CheckVersionWebRequest(web);
}
if (needUpdate)
{
url = "https://raw.githubusercontent.com/monitor1394/unity-ugui-XCharts/master/Assets/XCharts/CHANGELOG.md";
web = UnityWebRequest.Get(url);
#if UNITY_5
yield return web.Send();
#else
yield return web.SendWebRequest();
#endif
if (!CheckLogWebRequest(web))
{
url = "https://gitee.com/monitor1394/unity-ugui-XCharts/raw/master/Assets/XCharts/CHANGELOG.md";
web = UnityWebRequest.Get(url);
#if UNITY_5
yield return web.Send();
#else
yield return web.SendWebRequest();
#endif
CheckLogWebRequest(web);
}
}