예제 #1
0
    public void ShowRewardAD(OnAdRewardCallBack callBack)
    {
        if (IsAdReady)
        {
            var options = new ShowOptions {
                resultCallback = HandleShowResult
            };
            if (SpoilManager.CanSkip == true)
            {
                Advertisement.Show("BreakTimeVideo", options);
            }
            else if (SpoilManager.CanSkip == false)
            {
                Advertisement.Show("SpoilerAd", options);
                SpoilManager.CanSkip = true;
            }

            IsAdReady = false;
            this.onAdRewardCallBack = callBack;
        }
    }
예제 #2
0
    private void HandleShowResult(ShowResult result)
    {
        switch (result)
        {
        case ShowResult.Finished:
            Debug.Log("finished");
            if (this.onAdRewardCallBack != null)
            {
                this.onAdRewardCallBack();
                this.onAdRewardCallBack = null;
            }
            break;

        case ShowResult.Skipped:
            Debug.Log("Skipped");
            break;

        case ShowResult.Failed:
            Debug.Log("Failed");
            CheckRewardIsReady();
            break;
        }
    }