public List <NoticeInfo> WGGetNoticeData(string scene) { string noticeDataStr = iOSConnector.GetNoticeData(scene); if (noticeDataStr != null) { return(NoticeInfoList.ParseJson(noticeDataStr)); } else { return(new List <NoticeInfo>()); } }
public static List <NoticeInfo> ParseJson(string json) { Debug.Log("len:" + json.Length + "NoticeInfo:" + json); try{ JsonData datas = JsonMapper.ToObject(json); if (datas[JsonKeyConst.NOTICE_LIST].IsArray) { NoticeInfoList noticeList = JsonMapper.ToObject <NoticeInfoList>(json); return(noticeList.list); } }catch (Exception ex) { Debug.Log("errro:" + ex.Message + "\n" + ex.StackTrace); } return(null); }