コード例 #1
0
 public void HideInterstitial()
 {
     if (interstitial != null)
     {
         interstitial.Destroy();
     }
 }
コード例 #2
0
    private void InterstitialReklamYukle()
    {
        if (string.IsNullOrEmpty(interstitialKimligi))
        {
            return;
        }

        if (interstitialReklam != null)
        {
            interstitialReklam.Destroy();
        }

        if (testModu && string.IsNullOrEmpty(testDeviceID))
        {
#if UNITY_ANDROID
            interstitialReklam = new InterstitialAd("ca-app-pub-3940256099942544/1033173712");
#elif UNITY_IOS
            interstitialReklam = new InterstitialAd("ca-app-pub-3940256099942544/4411468910");
#endif
        }
        else
        {
            interstitialReklam = new InterstitialAd(interstitialKimligi);
        }

        interstitialReklam.OnAdClosed       += InterstitialDelegate;
        interstitialReklam.OnAdFailedToLoad += InterstitialYuklenemedi;
        interstitialReklam.LoadAd(ReklamIstegiOlustur());

        interstitialIstekTimeoutZamani = Time.realtimeSinceStartup + 10f;
    }
コード例 #3
0
 public void DestoryInterstitialAd()
 {
     if (interstitialAd != null)
     {
         interstitialAd.Destroy();
     }
 }
コード例 #4
0
 void CloseInterstitialAd()
 {
     if (interstitial != null)
     {
         interstitial.Destroy();
     }
 }
コード例 #5
0
    public void Init_InterstitialAd()
    {
#if UNITY_EDITOR
        string adUnitId = "unused";
#elif UNITY_ANDROID
        string adUnitId = InterstitialAd_Android_ID;
#elif UNITY_IPHONE
        string adUnitId = InterstitialAd_IOS_ID;
#else
        string adUnitId = "unexpected_platform";
#endif

        // Clean up interstitial before using it
        if (interstitialAd != null)
        {
            interstitialAd.Destroy();
        }
        interstitialAd = new InterstitialAd(adUnitId);

        // Add Event Handlers
        interstitialAd.OnAdLoaded             += HandleOnAdLoaded_InterstitialAd;
        interstitialAd.OnAdFailedToLoad       += HandleOnAdFailedToLoad_InterstitialAd;
        interstitialAd.OnAdOpening            += HandleOnAdOpened_InterstitialAd;
        interstitialAd.OnAdClosed             += HandleOnAdClosed_InterstitialAd;
        interstitialAd.OnAdLeavingApplication += HandleOnAdLeavingApplication_InterstitialAd;

        // Load an interstitial ad
        interstitialAd.LoadAd(CreateAdRequest());
    }
コード例 #6
0
    public void RequestAndLoadInterstitialAd()
    {
        statusText.text = "Requesting Interstitial Ad.";
#if UNITY_EDITOR
        string adUnitId = "unused";
#elif UNITY_ANDROID
        string adUnitId = "ca-app-pub-3940256099942544/1033173712";
#elif UNITY_IPHONE
        string adUnitId = "ca-app-pub-3940256099942544/4411468910";
#else
        string adUnitId = "unexpected_platform";
#endif

        // Clean up interstitial before using it
        if (interstitialAd != null)
        {
            interstitialAd.Destroy();
        }

        interstitialAd = new InterstitialAd(adUnitId);

        // Add Event Handlers
        interstitialAd.OnAdLoaded             += (sender, args) => OnAdLoadedEvent.Invoke();
        interstitialAd.OnAdFailedToLoad       += (sender, args) => OnAdFailedToLoadEvent.Invoke();
        interstitialAd.OnAdOpening            += (sender, args) => OnAdOpeningEvent.Invoke();
        interstitialAd.OnAdClosed             += (sender, args) => OnAdClosedEvent.Invoke();
        interstitialAd.OnAdLeavingApplication += (sender, args) => OnAdLeavingApplicationEvent.Invoke();

        // Load an interstitial ad
        interstitialAd.LoadAd(CreateAdRequest());
    }
コード例 #7
0
    private void Intersititial_AdClosed(object sender, System.EventArgs e)
    {
        //throw new System.NotImplementedException();
        if (intersititial != null)
        {
            intersititial.Destroy();
            LeanTween.dispatchEvent((int)Events.INTERSTITIALCLOSED);
        }

        RequestInterstitial();
    }
コード例 #8
0
 public void Clear()
 {
     if (null != m_banner)
     {
         m_banner.Destroy();
     }
     if (null != m_interstitial)
     {
         m_interstitial.Destroy();
     }
 }
コード例 #9
0
 public void ShowInterstitial()
 {
     if (interstitial.IsLoaded())
     {
         interstitial.Show();
     }
     else
     {
         interstitial.Destroy();
         InterstitialSetup();
     }
 }
コード例 #10
0
ファイル: BackEndManager.cs プロジェクト: shiftay/TownCG
 public void HandleOnAdClosed(object sender, EventArgs args)
 {
     if (firstRun)
     {
         BackEndManager.instance.ChangeState(STATES.TUTORIAL);
     }
     else
     {
         BackEndManager.instance.ChangeState(STATES.MAINMENU);
     }
     inter.Destroy();
 }
コード例 #11
0
 void OnApplicationQuit()
 {
     foreach (int fileId in loadedFiles)
     {
         AndroidNativeAudio.unload(fileId);
     }
     AndroidNativeAudio.releasePool();
     if (interstitial != null)
     {
         interstitial.Destroy();
     }
 }
コード例 #12
0
ファイル: AdManager.cs プロジェクト: Syldarion/MemoryMash
    private void InterstitialAdClosed(object sender, EventArgs args)
    {
        OnInterstitialAdClosed.Invoke();

        if (activeInterstitial == null)
        {
            return;
        }

        activeInterstitial.Destroy();
        activeInterstitial = null;
    }
コード例 #13
0
 static void InterstitialAdClose(object sender, EventArgs args)
 {
     Debug.Log("**********************\n**********************\nInterstitial close");
             #if UNITY_IOS
     AudioListener.pause = false;
     Time.timeScale      = 1;                        //optional to continue the game
     interstitial.Destroy();
     RequestInterstitial();
             #endif
             #if UNITY_ANDROID
     instance.StartCoroutine(InterstitialDone());
             #endif
 }
コード例 #14
0
        public void ActivatePremium()
        {
            IsPremiumUser = true;

            if (bannerView != null)
            {
                bannerView.Destroy();
            }

            if (interstitialAd != null)
            {
                interstitialAd.Destroy();
            }
        }
コード例 #15
0
    void InterstitialReklamAl()
    {
        if (interstitialReklam != null)
        {
            interstitialReklam.Destroy();
        }

        interstitialReklam             = new InterstitialAd(interstitialID);
        interstitialReklam.OnAdClosed -= InterstitialDelegate;
        interstitialReklam.OnAdClosed += InterstitialDelegate;

        AdRequest reklamiAl;

        if (testMod)
        {
            reklamiAl = new AdRequest.Builder().AddTestDevice(AdRequest.TestDeviceSimulator)
                        .AddTestDevice(testDeviceID).Build();
        }
        else
        {
            reklamiAl = new AdRequest.Builder().Build();
        }

        interstitialReklam.LoadAd(reklamiAl);
    }
コード例 #16
0
 private void DestroyInterstitial()
 {
     if (interstitial != null)
     {
         interstitial.Destroy();
     }
 }
コード例 #17
0
ファイル: Ads.cs プロジェクト: crazy78cyxapuk/Supererant2D
    public void HandleOnAdClosed(object sender, EventArgs args)
    {
        interstitial.Destroy();

        interstitial.OnAdClosed -= HandleOnAdClosed;
        interstitial.OnAdLoaded -= HandleOnAdLoaded;
    }
コード例 #18
0
ファイル: AdMobManager.cs プロジェクト: terasha/CubeJump
 private void FowardOnClose(object sender, EventArgs args)
 {
     mInterstitialAD.Destroy();
     mInterstitialAD = new InterstitialAd(mInterstitialAD_Key);
     AddFowardBannerEvent();
     mInterstitialAD.LoadAd(request);
 }
コード例 #19
0
 public void HideInterstitial()
 {
     if (interstitial.IsLoaded())
     {
         interstitial.Destroy();
     }
 }
コード例 #20
0
        /// <summary>
        /// Destroy an interstitial ad and invoke the InterstitialAdCompleted event.
        /// </summary>
        /// Called in HandleAdMobInterstitialClosed event handler.
        private void CloseInterstititlaAd(AdPlacement placement)
        {
            if (placement == AdPlacement.Default) // Default interstitial ad...
            {
                // Note: On iOS, InterstitialAd objects are one time use objects.
                // ==> Destroy the used interstitial ad object; also reset
                // the reference to force new objects to be created when loading ads.
                if (mDefaultInterstitialAd != null)
                {
                    mDefaultInterstitialAd.Destroy();
                    mDefaultInterstitialAd = null;
                }
            }
            else // Custom interstitial ad...
            {
                if (mCustomInterstitialAds != null && mCustomInterstitialAds.ContainsKey(placement) && mCustomInterstitialAds[placement] != null)
                {
                    mCustomInterstitialAds[placement].Destroy();
                    mCustomInterstitialAds[placement] = null;
                }
            }

            // Make sure the event is raised on main thread.
            RuntimeHelper.RunOnMainThread(() =>
            {
                OnInterstitialAdCompleted(placement);
            });
        }
コード例 #21
0
ファイル: AdMobManager.cs プロジェクト: glorykim1216/Jump
    public void RequestInterstitial()
    {
#if UNITY_ANDROID
        string adUnitId = Android_Interstitial;
#elif UNITY_IPHONE
        string adUnitId = ios_Interstitial;
#else
        string adUnitId = "unexpected_platform";
#endif

        if (is_close_interstitial == true)
        {
            interstitial.Destroy();
        }

        // Initialize an InterstitialAd.
        interstitial = new InterstitialAd(adUnitId);
        // Create an empty ad request.
        request = new AdRequest.Builder().Build();
        // Load the interstitial with the request.
        interstitial.LoadAd(request);

        interstitial.OnAdClosed += HandleAdClosed;

        is_close_interstitial = false;
    }
コード例 #22
0
    private void OnTriggerEnter(Collider other)
    {
        Time.timeScale = 0;

        if (interstitial.IsLoaded())
        {
            interstitial.Show();
            interstitial.Destroy();
        }

        if (other.name == "Player")
        {
            if (PlayerPrefs.GetInt("HighestLvl") >= lvl)
            {
                Destroy(gameObject);
                SceneManager.LoadScene("Level Select");
            }

            else if (PlayerPrefs.GetInt("HighestLvl", 0) < lvl)
            {
                PlayerPrefs.SetInt("HighestLvl", lvl);

                Destroy(gameObject);

                EndScreen.SetActive(true);
            }
        }
    }
コード例 #23
0
    void RequestInterstitial()
    {
        if (interstitial != null)
        {
            interstitial.Destroy();
        }

        interstitial = new InterstitialAd(interstitial_ID);

        // Called when an ad request has successfully loaded.
        this.interstitial.OnAdLoaded += HandleOnAdLoaded;
        // Called when an ad request failed to load.
        this.interstitial.OnAdFailedToLoad += HandleOnAdFailedToLoad;
        // Called when an ad is shown.
        this.interstitial.OnAdOpening += HandleOnAdOpened;
        // Called when the ad is closed.
        this.interstitial.OnAdClosed += HandleOnAdClosed;
        // Called when the ad click caused the user to leave the application.
        this.interstitial.OnAdLeavingApplication += HandleOnAdLeavingApplication;


        AdRequest adRequest;

        if (!isTesting)
        {
            adRequest = new AdRequest.Builder().Build();
        }
        else //FOR TESTING
        {
            adRequest = new AdRequest.Builder().AddTestDevice("2077ef9a63d2b398840261c8221a0c9b").Build();
        }

        interstitial.LoadAd(adRequest);
    }
コード例 #24
0
    public void RequestInterstitial()
    {
#if UNITY_ANDROID
        string adUnitId = Android_Interstitial;
#elif UNITY_IPHONE
        string adUnitId = ios_Interstitial;
#else
        string adUnitId = "unexpected_platform";
#endif

        if (is_close_interstitial == true)
        {
            _interstitial.Destroy();
        }

        // Initialize an InterstitialAd.
        _interstitial = new InterstitialAd(adUnitId);
        // Create an empty ad request.
        AdRequest request = new AdRequest.Builder().AddTestDevice("").Build();
        // Load the interstitial with the request.
        _interstitial.LoadAd(request);
        my.tirasi_ok = 0;

        is_close_interstitial = false;
    }
コード例 #25
0
ファイル: Admob.cs プロジェクト: anviettrung/alchemist
    private void RequestInterstitial()
    {
        string adUnitID;

#if UNITY_ANDROID
        adUnitID = inter_ADR_ID;
#elif UNITY_IPHONE
        adUnitID = inter_IOS_ID;
#endif

        if (interstitial != null)
        {
            interstitial.Destroy();
        }

        interstitial = new InterstitialAd(adUnitID);

        // Called when an ad request has successfully loaded.
        this.interstitial.OnAdLoaded += HandleOnAdLoaded;
        // Called when an ad request failed to load.
        this.interstitial.OnAdFailedToLoad += HandleOnAdFailedToLoad;
        // Called when an ad is shown.
        this.interstitial.OnAdOpening += HandleOnAdOpened;
        // Called when the ad is closed.
        this.interstitial.OnAdClosed += HandleOnAdClosed;
        // Called when the ad click caused the user to leave the application.
        this.interstitial.OnAdLeavingApplication += HandleOnAdLeavingApplication;

        AdRequest request = new AdRequest.Builder().Build();
        interstitial.LoadAd(request);
    }
コード例 #26
0
 public void ClearInadsAdmob()
 {
     if (interstitial != null)
     {
         interstitial.Destroy();
     }
 }
コード例 #27
0
 public void close()
 {
     if (interstitial != null)
     {
         interstitial.Destroy();
     }
 }
コード例 #28
0
 private void ShowAds()
 {
     interstitial.Show();
     interstitial.Destroy();
     RequestInterstitial();
     timeShowAds = 0;
 }
コード例 #29
0
 public void destroyInterstitailAd()
 {
     if (PlayerPrefs.GetInt("Removeads", 0) == 0)
     {
         myInterstitialAd.Destroy();
     }
 }
コード例 #30
0
    public void RequestInterstitial()
    {
        if (interAd != null)
        {
            interAd.Destroy();
        }
        interAd = new InterstitialAd(interstitialAdID);

        // Called when an ad request has successfully loaded.
        interAd.OnAdLoaded += HandleInterstitialLoaded;
        // Called when an ad request failed to load.
        interAd.OnAdFailedToLoad += HandleInterstitialFailedToLoad;
        // Called when an ad is clicked.
        interAd.OnAdOpening += HandleInterstitialOpened;
        // Called when the user returned from the app after an ad click.
        interAd.OnAdClosed += HandleInterstitialClosed;
        // Called when the ad click caused the user to leave the application.
        interAd.OnAdLeavingApplication += HandleInterstitialLeftApplication;

        //AdRequest request = new AdRequest.Builder().Build();
        //for testing
        AdRequest request = new AdRequest.Builder().AddTestDevice("2077ef9a63d2b398840261c8221a0c9b").Build();

        interAd.LoadAd(request);
    }