|
public string[,] friends;//存储好友的多维数组
//好友列表
string strReadpListUrl = "http://**";//好友
代码:- IEnumerator GetPopupList()
- {
- poplist.items.Clear();
- WWW www = new WWW(strReadpListUrl);
- yield return www;
- JsonData jd = JsonMapper.ToObject(www.text);
- friends = new string[jd["Data"].Count,2];
- for (int i = 0; i < jd["Data"].Count;i++ )
- {
- poplist.items.Add(jd["Data"][i]["NickName"].ToString());
- friends[i, 0] = jd["Data"][i]["NickName"].ToString();
- friends[i, 1] = jd["Data"][i]["TargetUID"].ToString();
-
- }
- for (int i = 0; i < int.Parse(jd["Num"].ToString());i++ )
- {
- if(poplist.textLabel.text.ToString()==jd["Data"][i]["NickName"].ToString())
- {
- print("zhidingde ren TargetUID is"+jd["Data"][i]["TargetUID"]);
- }
- print("array TargetUID is"+jd["Data"][i]["TargetUID"]);
- }
- // print("Array[,] is"+friends.Length.ToString());
- print("111111111111"+jd["Data"][0]["NickName"]);
- //poplist.items.Add("陈云贺");
- }
复制代码 |
|