using System; using System.Collections; using System.Collections.Generic; using UnityEditor.Hardware; using UnityEditorInternal.VersionControl; using UnityEngine; using UnityEngine.UI; public class InitInfo : MonoBehaviour { private MainObject parsedData; private Username userdata; public Text name; // Start is called before the first frame update private async void Start() { string response = await web.SendRequest("http://47.109.133.52/Player/GetInfo", "POST"); Debug.Log(response); parsedData = JsonUtility.FromJson(response); Debug.Log(parsedData.Info.Gold); AssestPanel.instance.SetCoinText(parsedData.Info.Gold); AssestPanel.instance.SetStoneText(parsedData.Info.Gem); GetListByPhone getlistbyphone = new GetListByPhone(); getlistbyphone.Phone = "1"; string jsonString = JsonUtility.ToJson(getlistbyphone); string userponse = await web.SendRequest("http://47.109.133.52/Player/GetListByPhone", "POST", jsonString); Debug.Log(userponse); <<<<<<< .mine //RootData RootData = LitJson.JsonMapper.ToObject(userponse RootData itemList = JsonUtility.FromJson(userponse); Debug.Log(itemList.List[0].Gold); if (itemList.List == null) { Debug.Log("list¿Õ"); //Debug.Log(rootData.); } ======= userdata = JsonUtility.FromJson(userponse); Debug.Log(userdata.ErrorCode); >>>>>>> .theirs //name.text=userdata.nameitem.Name; } // Update is called once per frame void Update() { } } public class MainObject { public Info Info; public int ErrorCode; public string ErrorMessage; } [Serializable] public class Info { public string Id; public int Gold; public int Gem; public string Phone; public string Name; } public class Username { public List namelist; public int ErrorCode; public string ErrorMessage; } public class nameitem { public string Id; public string Phone; public string Name; }