-
- 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[jd["Barriers"][0].Count, 3];
- for (int i = 0; i < jd["Barriers"][0].Count; i++)
- {
- ArrChapter[i, 0] = jd["Barriers"][0][i]["BarrierName"].ToString();
- ArrChapter[i, 1] = jd["Barriers"][0][i]["Picture"].ToString();
- ArrChapter[i, 2] = "33";
- }
- for (int i = 0; i < jd["Barriers"][0].Count; i++)
- {
- for (int j = 0; j < 3; j++)
- {
- print(ArrChapter[i, j].ToString());
- }
- }
- }
- catch (Exception ex)
- {
- print(ex.ToString());
- }
- }
- else
- {
- Debug.Log(www.error);
- }
- }
复制代码 |