Example #1
0
    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);
    }
Example #2
0
    void ShowAdEx(string zoneID = null, HandleShowResultDelegate handleFinished = null)
    {
        handleShowResultDelegate = handleFinished;
        ShowOptions options = new ShowOptions();

        options.resultCallback = HandleShowResult;
        Advertisement.Show(zoneID, options);
    }
Example #3
0
 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);
 }
Example #4
0
    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);
    }
Example #5
0
    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", "广告还没有准备好");
    }