예제 #1
0
    public IEnumerator ShowAd(OnPositiveResult clbk)
    {
        print("Adv ini: " + Advertisement.isInitialized);

        while (!Advertisement.IsReady())
        {
            yield return(new WaitForEndOfFrame());
        }

        ShowOptions so = new ShowOptions();

        so.resultCallback = OnShowResultado;
        onPositiveResult  = clbk;
        Advertisement.Show("rewardedVideo", so);



#if UNITY_EDITOR
        var currentTimeScale = Time.timeScale;
        Time.timeScale = 0;
        yield return(new WaitUntil(() => !Advertisement.isShowing));

        Time.timeScale = currentTimeScale;
#endif
    }
예제 #2
0
    public void AdShow(OnPositiveResult clbk)
    {
#if UNITY_ANDROID
        StartCoroutine(ShowAd(clbk));
#endif
    }