Exemple #1
0
 /// <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);
 }
Exemple #2
0
 public void HandleRelationNofify(RelationRet ret)
 {
     try {
         if (RelationEvent != null)
         {
             RelationEvent(ret);
         }
     } catch (Exception e) {
         Debug.LogError(e.Message);
     }
 }
Exemple #3
0
 public void HandleLocationNotify(RelationRet ret)
 {
     try {
         if (NearbyEvent != null)
         {
             NearbyEvent(ret);
         }
     } catch (Exception e) {
         Debug.LogError(e.Message);
     }
 }
Exemple #4
0
        public void OnLocationNotify(string jsonRet)
        {
            RelationRet ret = RelationRet.ParseJson(jsonRet);

            MsdkEvent.Instance.HandleLocationNotify(ret);
        }