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