Ejemplo n.º 1
0
 void ShowInterstitial(string adUnitId)
 {
     if (interstitial.IsReady(adUnitId))
     {
         interstitial.Show(adUnitId);
     }
     else
     {
         print("===> Reward video ad is not ready yet.");
     }
 }
Ejemplo n.º 2
0
 void ShowInterstitial(string adUnitId)
 {
     if (interstitial.IsReady(adUnitId))
     {
         interstitial.Show(adUnitId);
         print("atmosplay---show interstitial");
     }
     else
     {
         print("atmosplay---interstitial not ready");
     }
 }
Ejemplo n.º 3
0
    void Start()
    {
        AdSdk.Instance.DisableReturnAds();
        AdSdk.Instance.SetTestAdsEnabled(true);
        var config = new SplashConfig {
            TemplateTheme = SplashConfig.Theme.Blaze
        };

        AdSdk.Instance.ShowSplash(config);
        AdSdk.Instance.SetUserConsent(
            "pas",
            true,
            (long)DateTime.UtcNow.Subtract(new DateTime(1970, 1, 1)).TotalMilliseconds);

        // AdSdk.Instance.ShowDefaultAd();

        ad = AdSdk.Instance.CreateInterstitial("myTagForFullscreen");
        ad.RaiseAdLoaded += (sender, e) => {
            Debug.Log("Unity::RaiseAdLoaded");
            if (ad.IsReady())
            {
                ad.ShowAd();
            }
        };

        ad.RaiseAdShown          += (sender, e) => Debug.Log("Unity::RaiseAdShown");
        ad.RaiseAdImpressionSent += (sender, e) => Debug.Log("Unity::RaiseAdImpressionSent");
        ad.RaiseAdLoadingFailed  += (sender, e) => Debug.Log(string.Format("Unity::RaiseAdLoadingFailed {0}", e.Message));
        ad.RaiseAdClosed         += (sender, e) => Debug.Log("Unity::RaiseAdClosed");
        ad.RaiseAdClicked        += (sender, e) => Debug.Log("Unity::RaiseAdClicked");
        ad.RaiseAdVideoCompleted += (sender, e) => Debug.Log("Unity::RaiseAdVideoCompleted");
        InvokeRepeating("LoadInterstitial", 10.0f, 0.0f);

        var banner = AdSdk.Instance.CreateBanner("myTagForBanner");

        banner.ShowInPosition(BannerAd.BannerPosition.Top, BannerAd.BannerType.Mrec);

        banner.RaiseBannerShown          += (sender, e) => Debug.Log("Unity::RaiseBannerShown");
        banner.RaiseBannerImpressionSent += (sende, e) => Debug.Log("Unity::RaiseBannerImpressionSent");
        banner.RaiseBannerLoadingFailed  += (sender, e) => Debug.Log(string.Format("Unity::RaiseBannerLoadingFailed {0}", e.Message));
        banner.RaiseBannerClicked        += (sender, e) => Debug.Log("Unity::RaiseBannerClicked");
        banner.Hide();

        if (!banner.IsShownInPosition(BannerAd.BannerPosition.Top))
        {
            // AdSdk.Instance.ShowDefaultBanner(BannerAd.BannerPosition.Bottom, "myBottomBanner");
            AdSdk.Instance.ShowDefaultBanner();
            banner.ShowInPosition(BannerAd.BannerPosition.Top);
        }
    }