Exemple #1
0
 public bool isReadyAdmobInterstitial()
 {
     if (ad.isInterstitialReady())
     {
         return(true);
     }
     return(false);
 }
Exemple #2
0
 public void showBannerRelative(AdSize size, int position, int marginY, string instanceName = "defaultBanner")
 {
     //bool pursed = GameData.GetPursedRemoveAds();
     //if (pursed)
     //{
     //	return;
     //}
     if (ad.isInterstitialReady())
     {
         ad.showInterstitial();
     }
     Admob.Instance().showBannerRelative(size, position, marginY);
 }
Exemple #3
0
    public void ShowInterstitial()
    {
        return;

        Debug.Log("touch inst button -------------");
        if (ad.isInterstitialReady())
        {
            ad.showInterstitial();
        }
        else
        {
            ad.loadInterstitial(interstitialID);
        }
    }
 //gets called from other classes inside the game
 public void showInterstitial()
 {
     print("Request for Full AD.");
     if (ad.isInterstitialReady())
     {
         ad.showInterstitial();
     }
 }
    public static void DoShowAd_FullScreen()
    {
        if (_pAdmob.isInterstitialReady() == false)
        {
            DoRequestAdmob_FullScreen(); Debug.LogWarning("전면 광고 재생 실패"); return;
        }

        _pAdmob.showInterstitial();
    }
Exemple #6
0
 void showInterstitial()
 {
     if (ad.isInterstitialReady())
     {
         ad.showInterstitial();
     }
     else
     {
         ad.loadInterstitial();
     }
 }
Exemple #7
0
 public void ShowInterstitialBasedAd()
 {
     if (_ad.isInterstitialReady())
     {
         _ad.showInterstitial();
     }
     else
     {
         _ad.loadInterstitial();
     }
 }
Exemple #8
0
 public void ShowInterstitial()
 {
     if (Ad.isInterstitialReady())
     {
         Ad.showInterstitial();
     }
     else
     {
         Ad.loadInterstitial();
     }
 }
Exemple #9
0
 public void ShowAd()
 {
     if (ad.isInterstitialReady())
     {
         ad.showInterstitial();
     }
     else
     {
         ad.loadInterstitial();
     }
 }
    void OnGUI()
    {
        if (GUI.Button(new Rect(120, 0, 100, 60), "showInterstitial"))
        {
            Debug.Log("touch inst button -------------");
            if (ad.isInterstitialReady())
            {
                ad.showInterstitial();
            }
            else
            {
                ad.loadInterstitial(interstitialID);
            }
        }
        if (GUI.Button(new Rect(240, 0, 100, 60), "showRewardVideo"))
        {
            Debug.Log("touch video button -------------");
            if (ad.isRewardedVideoReady())
            {
                ad.showRewardedVideo();
            }
            else
            {
                ad.loadRewardedVideo(videoID);
            }
        }
        if (GUI.Button(new Rect(0, 100, 100, 60), "showbanner"))
        {
            Admob.Instance().showBannerRelative(bannerID, AdSize.SMART_BANNER, AdPosition.BOTTOM_CENTER);
        }
        if (GUI.Button(new Rect(120, 100, 100, 60), "showbannerABS"))
        {
            Admob.Instance().showBannerAbsolute(bannerID, AdSize.BANNER, 20, 220, "mybanner");
        }
        if (GUI.Button(new Rect(240, 100, 100, 60), "removebanner"))
        {
            Admob.Instance().removeBanner();
            Admob.Instance().removeBanner("mybanner");
        }

        if (GUI.Button(new Rect(0, 200, 100, 60), "showNative"))
        {
            Admob.Instance().showNativeBannerRelative(nativeBannerID, new AdSize(320, 280), AdPosition.BOTTOM_CENTER);
        }
        if (GUI.Button(new Rect(120, 200, 100, 60), "showNativeABS"))
        {
            Admob.Instance().showNativeBannerAbsolute(nativeBannerID, new AdSize(-1, 132), 0, 300);
        }
        if (GUI.Button(new Rect(240, 200, 100, 60), "removeNative"))
        {
            Admob.Instance().removeNativeBanner();
        }
    }
    void OnGUI()
    {
        if (GUI.Button(new Rect(120, 0, 100, 60), "showInterstitial"))
        {
            if (ad.isInterstitialReady())
            {
                ad.showInterstitial();
            }
            else
            {
                ad.loadInterstitial();
            }
        }
        if (GUI.Button(new Rect(240, 0, 100, 60), "showRewardVideo"))
        {
            if (ad.isRewardedVideoReady())
            {
                ad.showRewardedVideo();
            }
            else
            {
                //ad.loadRewardedVideo("ca-app-pub-3120877784109998/4714341465");
                ad.loadRewardedVideo("ca-app-pub-4622924889224894/8984406965");
            }
        }
        if (GUI.Button(new Rect(0, 100, 100, 60), "showbanner"))
        {
            Admob.Instance().showBannerRelative(AdSize.SmartBanner, AdPosition.BOTTOM_CENTER, 0);
        }
        if (GUI.Button(new Rect(120, 100, 100, 60), "showbannerABS"))
        {
            Admob.Instance().showBannerAbsolute(AdSize.Banner, 0, 300);
        }
        if (GUI.Button(new Rect(240, 100, 100, 60), "removebanner"))
        {
            Admob.Instance().removeBanner();
        }
        string nativeBannerID = "ca-app-pub-6908989844804937/5541215009";//

        // string nativeBannerID = "ca-app-pub-3940256099942544/2562852117";//google
        if (GUI.Button(new Rect(0, 200, 100, 60), "showNative"))
        {
            Admob.Instance().showNativeBannerRelative(new AdSize(320, 120), AdPosition.BOTTOM_CENTER, 0, nativeBannerID);
        }
        if (GUI.Button(new Rect(120, 200, 100, 60), "showNativeABS"))
        {
            Admob.Instance().showNativeBannerAbsolute(new AdSize(320, 120), 0, 300, nativeBannerID);
        }
        if (GUI.Button(new Rect(240, 200, 100, 60), "removeNative"))
        {
            Admob.Instance().removeNativeBanner();
        }
    }
    void OnGUI()
    {
        if (GUI.Button(new Rect(120, 0, 200, 80), "showInterstitial显示间隙"))
        {
            Debug.Log("touch inst button -------------");
            if (ad.isInterstitialReady())
            {
                ad.showInterstitial();
            }
            else
            {
                ad.loadInterstitial();
            }
        }
        if (GUI.Button(new Rect(440, 0, 200, 80), "showRewardVideo显示奖励视频"))
        {
            Debug.Log("touch video button -------------");
            if (ad.isRewardedVideoReady())
            {
                ad.showRewardedVideo();
            }
            else
            {
                ad.loadRewardedVideo(videoID);
            }
        }
        if (GUI.Button(new Rect(0, 100, 200, 60), "showbanner横幅"))
        {
            Admob.Instance().showBannerRelative(AdSize.SmartBanner, AdPosition.BOTTOM_CENTER, 0);
        }
        if (GUI.Button(new Rect(220, 100, 200, 60), "showbannerABS"))
        {
            Admob.Instance().showBannerAbsolute(AdSize.Banner, 20, 300);
        }
        if (GUI.Button(new Rect(440, 100, 200, 60), "removebanner删除横幅"))
        {
            Admob.Instance().removeBanner();
        }

        if (GUI.Button(new Rect(0, 200, 200, 60), "showNative(本地人)"))
        {
            Admob.Instance().showNativeBannerRelative(new AdSize(320, 100), AdPosition.BOTTOM_CENTER, 0, nativeBannerID);
        }
        if (GUI.Button(new Rect(220, 200, 200, 60), "showNativeABS"))
        {
            Admob.Instance().showNativeBannerAbsolute(new AdSize(-1, 132), 20, 300, nativeBannerID);
        }
        if (GUI.Button(new Rect(440, 200, 200, 60), "removeNative"))
        {
            Admob.Instance().removeNativeBanner();
        }
    }
Exemple #13
0
    void OnGUI()
    {
        if (GUI.Button(new Rect(120, 0, 100, 60), "showInterstitial"))
        {
            if (ad.isInterstitialReady())
            {
                ad.showInterstitial();
            }
            else
            {
                ad.loadInterstitial();
            }
        }
        if (GUI.Button(new Rect(240, 0, 100, 60), "showRewardVideo"))
        {
            if (ad.isRewardedVideoReady())
            {
                ad.showRewardedVideo();
            }
            else
            {
                ad.loadRewardedVideo("ca-app-pub-3940256099942544/xxxxxxxxxxxx");
            }
        }
        if (GUI.Button(new Rect(0, 100, 100, 60), "showbanner"))
        {
            Admob.Instance().showBannerRelative(AdSize.SmartBanner, AdPosition.BOTTOM_CENTER, 0);
        }
        if (GUI.Button(new Rect(120, 100, 100, 60), "showbannerABS"))
        {
            Admob.Instance().showBannerAbsolute(AdSize.Banner, 0, 300);
        }
        if (GUI.Button(new Rect(240, 100, 100, 60), "removebanner"))
        {
            Admob.Instance().removeBanner();
        }

        string nativeBannerID = "ca-app-pub-3940256099942544/2562852117";//google

        if (GUI.Button(new Rect(0, 200, 100, 60), "showNative"))
        {
            Admob.Instance().showNativeBannerRelative(new AdSize(320, 120), AdPosition.BOTTOM_CENTER, 0, nativeBannerID);
        }
        if (GUI.Button(new Rect(120, 200, 100, 60), "showNativeABS"))
        {
            Admob.Instance().showNativeBannerAbsolute(new AdSize(320, 120), 0, 300, nativeBannerID);
        }
        if (GUI.Button(new Rect(240, 200, 100, 60), "removeNative"))
        {
            Admob.Instance().removeNativeBanner();
        }
    }
 /// <summary>
 /// Shows interstitial ad
 /// </summary>
 public void ShowInterstitial()
 {
     Debug.Log("pressed video button -------------");
     if (ad.isInterstitialReady())
     {
         ad.showInterstitial();
     }
     else
     {
         Debug.Log("Interstitial not loaded yet!");
         LoadInterstitial();
     }
 }
Exemple #15
0
    public void OnInterstitial()
    {
        if (PlayerPrefs.GetInt("noads", 0) == 1)
        {
            return;
        }
        Admob ad = Admob.Instance();

        if (ad.isInterstitialReady())
        {
            ad.showInterstitial();
        }
    }
Exemple #16
0
    void OnGUI()
    {
        if (GUI.Button(new Rect(60, 0, 200, 120), "showInterstitial"))
        {
            if (ad.isInterstitialReady())
            {
                ad.showInterstitial();
            }
            else
            {
                ad.loadInterstitial();
            }
        }
        if (GUI.Button(new Rect(300, 0, 200, 120), "showRewardVideo"))
        {
            if (ad.isRewardedVideoReady())
            {
                ad.showRewardedVideo();
            }
            else
            {
                ad.loadRewardedVideo("ca-app-pub-3940256099942544/1712485313");
            }
        }
        if (GUI.Button(new Rect(60, 150, 200, 120), "showbanner"))
        {
            Admob.Instance().showBannerRelative(AdSize.SmartBanner, AdPosition.BOTTOM_CENTER, 0);
        }
        if (GUI.Button(new Rect(300, 150, 200, 120), "showbannerABS"))
        {
            Admob.Instance().showBannerAbsolute(AdSize.Banner, 20, 300);
        }
        if (GUI.Button(new Rect(60, 300, 200, 120), "removebanner"))
        {
            Admob.Instance().removeBanner();
        }
        string nativeBannerID = "ca-app-pub-3940256099942544/2934735716";

        if (GUI.Button(new Rect(300, 300, 200, 120), "showNative"))
        {
            Admob.Instance().showNativeBannerRelative(new AdSize(320, 120), AdPosition.BOTTOM_CENTER, 0, nativeBannerID);
        }
        if (GUI.Button(new Rect(60, 450, 200, 120), "showNativeABS"))
        {
            Admob.Instance().showNativeBannerAbsolute(new AdSize(320, 120), 20, 300, nativeBannerID);
        }
        if (GUI.Button(new Rect(300, 450, 200, 120), "removeNative"))
        {
            Admob.Instance().removeNativeBanner();
        }
    }
    public void GameOver()
    {
        Admob.Instance().removeAllBanner();
        if (ad.isInterstitialReady())
        {
            if (adFlag)
            {
                ad.showInterstitial();
                ad.loadInterstitial();
                adFlag = false;
            }
        }
        else
        {
            if (adFlag)
            {
                ad.loadInterstitial();
            }
        }
        //**********************************************************************************
        var clones = GameObject.FindGameObjectsWithTag("Card");

        foreach (var clone in clones)
        {
            Destroy(clone);
        }
        if (highScore < ct)
        {
            highScore = ct;
            highScoreEffect.active = true;
            game.submitLeaderboardScore("CgkIst_x8acJEAIQAQ", highScore);
        }


        PlayerPrefs.SetInt("highscore", highScore);
        PlayerPrefs.SetInt("gameTime", (int)gameTime);
        PlayerPrefs.SetInt("swipeTime", swipeTime);
        PlayerPrefs.Save();

        isGameOver             = true;
        Time.timeScale         = 1;
        endGame.text           = "YOUR SCORE\n" + ct + "\nHIGH SCORE\n" + highScore;
        scoreText.text         = "GAME OVER";
        timeText.text          = "";
        playAgainButton.active = true;
        homePageButton.active  = true;
    }
    void OnGUI()
    {
        if (GUI.Button(new Rect(0, 0, 100, 60), "initadmob"))
        {
            Admob ad = Admob.Instance();

            ad.initAdmob("YOUR_VALUE_HERE", "YOUR_VALUE_HERE");

            //   ad.setTesting(true);
        }
        if (GUI.Button(new Rect(120, 0, 100, 60), "showInterstitial"))
        {
            Admob ad = Admob.Instance();
            if (ad.isInterstitialReady())
            {
                ad.showInterstitial();
            }
            else
            {
                ad.loadInterstitial();
            }
        }
        if (GUI.Button(new Rect(240, 0, 100, 60), "showRewardVideo"))
        {
            Admob ad = Admob.Instance();
            if (ad.isRewardedVideoReady())
            {
                ad.showRewardedVideo();
            }
            else
            {
                ad.loadRewardedVideo("YOUR_VALUE_HERE");
            }
        }
        if (GUI.Button(new Rect(240, 100, 100, 60), "showbanner"))
        {
            Admob.Instance().showBannerRelative(AdSize.Banner, AdPosition.BOTTOM_CENTER, 0);
        }
        if (GUI.Button(new Rect(240, 200, 100, 60), "showbannerABS"))
        {
            Admob.Instance().showBannerAbsolute(AdSize.SmartBanner, 0, 30);
        }
        if (GUI.Button(new Rect(240, 300, 100, 60), "hidebanner"))
        {
            Admob.Instance().removeBanner();
        }
    }
    void OnGUI()
    {
        if (GUI.Button(new Rect(0, 0, 100, 60), "initadmob"))
        {
            Admob ad = Admob.Instance();

            ad.initAdmob("ca-app-pub-3940256099942544/2934735716", "ca-app-pub-3940256099942544/4411468910");

            //   ad.setTesting(true);
        }
        if (GUI.Button(new Rect(120, 0, 100, 60), "showInterstitial"))
        {
            Admob ad = Admob.Instance();
            if (ad.isInterstitialReady())
            {
                ad.showInterstitial();
            }
            else
            {
                ad.loadInterstitial();
            }
        }
        if (GUI.Button(new Rect(240, 0, 100, 60), "showRewardVideo"))
        {
            Admob ad = Admob.Instance();
            if (ad.isRewardedVideoReady())
            {
                ad.showRewardedVideo();
            }
            else
            {
                ad.loadRewardedVideo("ca-app-pub-3940256099942544/xxxxxxxxxxx");
            }
        }
        if (GUI.Button(new Rect(240, 100, 100, 60), "showbanner"))
        {
            Admob.Instance().showBannerRelative(AdSize.Banner, AdPosition.BOTTOM_CENTER, 0);
        }
        if (GUI.Button(new Rect(240, 200, 100, 60), "showbannerABS"))
        {
            Admob.Instance().showBannerAbsolute(AdSize.SmartBanner, 0, 30);
        }
        if (GUI.Button(new Rect(240, 300, 100, 60), "hidebanner"))
        {
            Admob.Instance().removeBanner();
        }
    }
Exemple #20
0
    void Start()
    {
        Admob.Instance().bannerEventHandler        += onBannerEvent;
        Admob.Instance().interstitialEventHandler  += onInterstitialEvent;
        Admob.Instance().rewardedVideoEventHandler += onRewardedVideoEvent;

        Admob ad = Admob.Instance();

        ad.initAdmob("app id", "app id");         // See it in your admob account for particular app. Get these ids from Admob account.

        int choose = Random.Range(0, 3);

        // Randomly selection of what to display.......
        switch (choose)
        {
        case 0:                         // Full Screen Ads...
            ad = Admob.Instance();
            if (ad.isInterstitialReady())
            {
                ad.showInterstitial();
            }
            else
            {
                ad.loadInterstitial();
            }
            break;

        case 1:                         // Rewarded Videos
            ad = Admob.Instance();
            if (ad.isRewardedVideoReady())
            {
                ad.showRewardedVideo();
            }
            else
            {
                ad.loadRewardedVideo("ca-app-pub-3940256099942544/xxxxxxxxxxx");                                 // Provide your Id here...
            }
            break;

        case 2:                         //  Banner Ads
            Admob.Instance().showBannerRelative(AdSize.Banner, AdPosition.BOTTOM_CENTER, 0);
            break;
        }
    }
Exemple #21
0
 void OnGUI()
 {
     if (GUI.Button(new Rect(0, 0, 100, 60), "initadmob"))
     {
         Admob ad = Admob.Instance();
          #if UNITY_IOS
         ad.initAdmob("ca-app-pub-27960454450664210/xxxxxxxxx", "ca-app-pub-279343530664210/xxxxxxxxxxx");
         #else
         ad.initAdmob("ca-app-pub-27960454450664210/xxxxxxxxx", "ca-app-pub-279343530664210/xxxxxxxxxxx");
         #endif
         //   ad.setTesting(true);
     }
     if (GUI.Button(new Rect(120, 0, 100, 60), "showfull"))
     {
         Admob ad = Admob.Instance();
         if (ad.isInterstitialReady())
         {
             ad.showInterstitial();
         }
         else
         {
             ad.loadInterstitial();
         }
     }
     if (GUI.Button(new Rect(240, 100, 100, 60), "showbanner"))
     {
         Admob.Instance().showBannerRelative(AdSize.Banner, AdPosition.BOTTOM_CENTER, 0);
     }
     if (GUI.Button(new Rect(240, 200, 100, 60), "showbannerABS"))
     {
         Admob.Instance().showBannerAbsolute(AdSize.Banner, 0, 30);
     }
     if (GUI.Button(new Rect(240, 300, 100, 60), "hidebanner"))
     {
         Admob.Instance().removeBanner();
     }
 }