/// <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); }
public void HandleADBackPressedNotify(ADRet ret) { try { if (ADBackPressedEvent != null) { ADBackPressedEvent(ret); } } catch (Exception e) { Debug.LogError(e.Message); } }
public void HandleShowADNotify(ADRet ret) { try { if (ShowADEvent != null) { ShowADEvent(ret); } } catch (Exception e) { Debug.LogError(e.Message); } }
public void OnADBackPressedNotify(string jsonRet) { ADRet ret = ADRet.ParseJson(jsonRet); MsdkEvent.Instance.HandleADBackPressedNotify(ret); }
public void OnADNotify(string jsonRet) { ADRet ret = ADRet.ParseJson(jsonRet); MsdkEvent.Instance.HandleShowADNotify(ret); }