Exemplo n.º 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);
 }
Exemplo n.º 2
0
 public void HandleADBackPressedNotify(ADRet ret)
 {
     try {
         if (ADBackPressedEvent != null)
         {
             ADBackPressedEvent(ret);
         }
     } catch (Exception e) {
         Debug.LogError(e.Message);
     }
 }
Exemplo n.º 3
0
 public void HandleShowADNotify(ADRet ret)
 {
     try {
         if (ShowADEvent != null)
         {
             ShowADEvent(ret);
         }
     } catch (Exception e) {
         Debug.LogError(e.Message);
     }
 }
Exemplo n.º 4
0
        public void OnADBackPressedNotify(string jsonRet)
        {
            ADRet ret = ADRet.ParseJson(jsonRet);

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

            MsdkEvent.Instance.HandleShowADNotify(ret);
        }