private static void FireInterstitialWasViewed()
 {
     if (ADInterstitialAd.onInterstitialWasViewed != null)
     {
         ADInterstitialAd.onInterstitialWasViewed();
     }
 }
Beispiel #2
0
    void WantToShowAD()
    {
        #if STAN_ASSET_GOOGLEMOBILEADS || STAN_ASSET_ANDROIDNATIVE || GOOGLE_MOBILE_ADS
        if (useAdmob)
        {
            return;
        }
        #endif

        print("WantToShowAD");
        if (fullscreenAd == null)
        {
            print("iOS fullscreenAd is null, creating...");
            fullscreenAd = new ADInterstitialAd();
        }
        else
        {
            if (fullscreenAd.loaded)
            {
                print("iOS fullscreenAd.loaded = true, showing...");
                fullscreenAd.Show();
            }
            else
            {
                print("iOS fullscreenAd.loaded = false, reloading...");
                fullscreenAd.ReloadAd();
            }
        }
    }
        private static IntPtr Native_CreateInterstitial(bool autoReload)
        {
            IntPtr result;

            ADInterstitialAd.INTERNAL_CALL_Native_CreateInterstitial(autoReload, out result);
            return(result);
        }
 private static void FireInterstitialWasViewed()
 {
     if (ADInterstitialAd.onInterstitialWasViewed == null)
     {
         return;
     }
     ADInterstitialAd.onInterstitialWasViewed();
 }
Beispiel #5
0
 private void CtorImpl(bool autoReload)
 {
     if (ADInterstitialAd._AlwaysFalseDummy)
     {
         ADInterstitialAd.FireInterstitialWasLoaded();
     }
     this.interstitialView = ADInterstitialAd.Native_CreateInterstitial(autoReload);
 }
 /// <summary>
 ///   <para>Shows full-screen advertisement to user.</para>
 /// </summary>
 public void Show()
 {
     if (this.loaded)
     {
         ADInterstitialAd.Native_ShowInterstitial(this.interstitialView);
     }
     else
     {
         Debug.Log((object)"Calling ADInterstitialAd.Show() when the ad is not loaded");
     }
 }
Beispiel #7
0
 public void ReloadInterstitial()
 {
     _canShowInterstitial = false;
     if (AdController.interstitialInventor == AdController.ADInventor.iad)
     {
         if (null == fullscreenAd)
         {
             fullscreenAd = new ADInterstitialAd();
             ADInterstitialAd.onInterstitialWasLoaded += OnFullscreenLoaded;
         }
         else
             fullscreenAd.ReloadAd();
         Debug.Log("Reload FullScreen");
     }    
 }
 public void ReloadInterstitial()
 {
     _canShowInterstitial = false;
     if (AdController.interstitialInventor == AdController.ADInventor.iad)
     {
         if (null == fullscreenAd)
         {
             fullscreenAd = new ADInterstitialAd();
             ADInterstitialAd.onInterstitialWasLoaded += OnFullscreenLoaded;
         }
         else
         {
             fullscreenAd.ReloadAd();
         }
         Debug.Log("Reload FullScreen");
     }
 }
Beispiel #9
0
    void Start()
    {
        if (pthis != null)
        {
            Lib.DestroyObject(this);
            return;
        }

        pthis = this;

        Lib.DontDestroyOnLoad(this);

        banner = new UnityEngine.iOS.ADBannerView(UnityEngine.iOS.ADBannerView.Type.Banner, UnityEngine.iOS.ADBannerView.Layout.Bottom);
        UnityEngine.iOS.ADBannerView.onBannerWasClicked += OnBannerClicked;
        UnityEngine.iOS.ADBannerView.onBannerWasLoaded  += OnBannerLoaded;

        fullscreenAd = new UnityEngine.iOS.ADInterstitialAd();
        UnityEngine.iOS.ADInterstitialAd.onInterstitialWasLoaded += OnFullscreenLoaded;
    }
 /// <summary>
 ///   <para>Reload advertisement.</para>
 /// </summary>
 public void ReloadAd()
 {
     ADInterstitialAd.Native_ReloadInterstitial(this.interstitialView);
 }
Beispiel #11
0
    IEnumerator Start()
    {
        yield return(0);

        GC.Collect();

        Resources.UnloadUnusedAssets();

        Application.targetFrameRate = 60;

        if (!NO_ADS)
        {
                        #if UNITY_IOS && (STAN_ASSET_GOOGLEMOBILEADS || STAN_ASSET_ANDROIDNATIVE || GOOGLE_MOBILE_ADS)
            if (!useAdmob)
            {
                        #endif
                                #if UNITY_IOS
            fullscreenAd = new ADInterstitialAd();
            ADInterstitialAd.onInterstitialWasLoaded += OnFullscreenLoaded;
                                #if !UNITY_4_6 && !UNITY_5_0 && !UNITY_5_1
            ADInterstitialAd.onInterstitialWasViewed += OnFullscreenViewed;
                                #endif
                                #endif

                                #if UNITY_IOS && (STAN_ASSET_GOOGLEMOBILEADS || STAN_ASSET_ANDROIDNATIVE || GOOGLE_MOBILE_ADS)
        }
                                #endif

                        #if STAN_ASSET_GOOGLEMOBILEADS
            if (!GoogleMobileAd.IsInited)
            {
                GoogleMobileAd.Init();
            }
                        #endif

                        #if STAN_ASSET_ANDROIDNATIVE
            if (!AndroidAdMobController.Instance.IsInited)
            {
                Set();
            }
                        #endif

                        #if CHARTBOOST
            Chartboost.setAutoCacheAds(true);

            Chartboost.cacheInterstitial(CBLocation.Default);

            Chartboost.cacheRewardedVideo(CBLocation.Default);
                        #endif

            yield return(new WaitForSeconds(1));

            ShowBanner();

            yield return(new WaitForSeconds(1));

            if (ShowIntertitialAtStart)
            {
                _ShowInterstitial();
            }
        }
    }
	public IAdsFullScreen()
#if UNITY_IOS
	{
		fullscreenAd = new UnityEngine.iOS.ADInterstitialAd();
		UnityEngine.iOS.ADInterstitialAd.onInterstitialWasLoaded += OnFullscreenLoaded;
	}
 public void HideInterstitial()
 {
     fullscreenAd         = null;
     _canShowInterstitial = false;
     Debug.Log("Hide FullScreen");
 }
Beispiel #14
0
 public void HideInterstitial()
 {
     fullscreenAd = null;
     _canShowInterstitial = false;
     Debug.Log("Hide FullScreen");
 }