using System.Collections;
using UnityEngine;
using UnityEngine.Networking;
public class RequestJosn : MonoBehaviour
{
private string url = "http://xx.xx.xxx.xxx/gamedata";
IEnumerator Start()
{
UnityWebRequest www = UnityWebRequest.Get(url);
yield return www.SendWebRequest();
if (www.isNetworkError || www.isHttpError)
{
Debug.Log(www.error);
}
else
{
Debug.Log(www.downloadHandler.text);
}
}
}
Unity请求后台json数据
最新推荐文章于 2024-05-19 22:19:27 发布