public void HandleLocationGotNotify(LocationRet ret) { try { if (LocateEvent != null) { LocateEvent(ret); } } catch (Exception e) { Debug.LogError(e.Message); } }
/// <summary> /// 解析json串,返回一个LocationRet,若解析失败返回null. /// </summary> /// <returns>The json.</returns> /// <param name="json">Json.</param> public static LocationRet ParseJson(string json) { try{ LocationRet ret = JsonMapper.ToObject <LocationRet>(json); return(ret); }catch (Exception ex) { Debug.Log("errro:" + ex.Message + "\n" + ex.StackTrace); } return(null); }
public void OnLocationGotNotify(string jsonRet) { LocationRet ret = LocationRet.ParseJson(jsonRet); MsdkEvent.Instance.HandleLocationGotNotify(ret); }