Unity3D判断json与www数据是否错误?
IEnumerator ReadChapter()
{
WWWForm form = new WWWForm();
//form.AddField("UserID", 21);
//http://zytsg.00299.com/?CH=Init&UserID=21
WWW www = new WWW("http://??/?");//, form);
yield return www;
if (www.error == null)
{
try
{
JsonData jd = JsonMapper.ToObject(www.text);
ArrChapter = new string.Count, 3];
for (int i = 0; i < jd["Barriers"].Count; i++)
{
ArrChapter = jd["Barriers"]["BarrierName"].ToString();
ArrChapter = jd["Barriers"]["Picture"].ToString();
ArrChapter = "33";
}
for (int i = 0; i < jd["Barriers"].Count; i++)
{
for (int j = 0; j < 3; j++)
{
print(ArrChapter.ToString());
}
}
}
catch (Exception ex)
{
print(ex.ToString());
}
}
else
{
Debug.Log(www.error);
}
} 感谢楼主分享 谢谢 谢谢分享 很不错 顶顶多好 真心顶 说的非常好 不错不错 很不错 楼主是超人
页:
[1]