public bool ShowAd(string zoneID = null, HandleShowResultDelegate handleFinished = null, bool excuse = false) { if (string.IsNullOrEmpty(zoneID)) { zoneID = null; } if (Advertisement.IsReady(zoneID)) { if (excuse) { UIChangeDelegate uiChange = delegate(UIData data) { if (data.uiChangeType == UIChangeType.Pop) { ShowAdEx(zoneID, handleFinished); } }; UIController.Instance.PushHint("ShowAdExcuse", "致歉", null, false, uiChange, 5.5f); } else { ShowAdEx(zoneID, handleFinished); } return(true); } return(false); }
void ShowAdEx(string zoneID = null, HandleShowResultDelegate handleFinished = null) { handleShowResultDelegate = handleFinished; ShowOptions options = new ShowOptions(); options.resultCallback = HandleShowResult; Advertisement.Show(zoneID, options); }
public bool ShowAd(string zoneID = null, HandleShowResultDelegate handleFinished = null) { if (string.IsNullOrEmpty(zoneID)) { zoneID = null; } if (Advertisement.IsReady(zoneID)) { handleShowResultDelegate = handleFinished; ShowOptions options = new ShowOptions(); options.resultCallback = HandleShowResult; Advertisement.Show(zoneID, options); return(true); } return(false); }
public bool PopAd(HandleShowResultDelegate handleFinished = null) { UADManager uad = UADManager.Instance; if (uad.ShowAd("video", handleFinished)) { return(true); } if (uad.ShowAd("display", handleFinished)) { return(true); } if (uad.ShowAd("rewardedVideo", handleFinished)) { return(true); } return(false); }
public void ShowRewardedAd(HandleShowResultDelegate handleFinished = null) { UADManager uad = UADManager.Instance; if (uad.ShowAd("rewardedVideo", handleFinished)) { return; } if (uad.ShowAd("video", handleFinished)) { return; } if (uad.ShowAd("display", handleFinished)) { return; } UIController.Instance.PushHint("ShowRewardedAd", "广告还没有准备好"); }