Beispiel #1
0
 /// <summary>
 /// 解析json串,返回一个ADRet,若解析失败返回null.
 /// </summary>
 /// <returns>The json.</returns>
 /// <param name="json">Json.</param>
 public static ADRet ParseJson(string json)
 {
     try{
         ADRet ret = JsonMapper.ToObject <ADRet>(json);
         return(ret);
     }catch (Exception ex)
     {
         Debug.Log("errro:" + ex.Message + "\n" + ex.StackTrace);
     }
     return(null);
 }
Beispiel #2
0
 public void HandleADBackPressedNotify(ADRet ret)
 {
     try {
         if (ADBackPressedEvent != null)
         {
             ADBackPressedEvent(ret);
         }
     } catch (Exception e) {
         Debug.LogError(e.Message);
     }
 }
Beispiel #3
0
 public void HandleShowADNotify(ADRet ret)
 {
     try {
         if (ShowADEvent != null)
         {
             ShowADEvent(ret);
         }
     } catch (Exception e) {
         Debug.LogError(e.Message);
     }
 }
Beispiel #4
0
        public void OnADBackPressedNotify(string jsonRet)
        {
            ADRet ret = ADRet.ParseJson(jsonRet);

            MsdkEvent.Instance.HandleADBackPressedNotify(ret);
        }
Beispiel #5
0
        public void OnADNotify(string jsonRet)
        {
            ADRet ret = ADRet.ParseJson(jsonRet);

            MsdkEvent.Instance.HandleShowADNotify(ret);
        }