コード例 #1
0
ファイル: UM_AdManager.cs プロジェクト: bigstupidx/FlappyStar
    public static void ShowInterstitialAd()
    {
        switch (Application.platform)
        {
        case RuntimePlatform.IPhonePlayer:

            if (UltimateMobileSettings.Instance.IOSAdEdngine == UM_IOSAdEngineOprions.GoogleMobileAd)
            {
                GoogleMobileAd.ShowInterstitialAd();
            }
            else
            {
                iAdBannerController.instance.ShowInterstitialAd();
            }
            break;

        case RuntimePlatform.Android:
            GoogleMobileAd.ShowInterstitialAd();
            break;

        case RuntimePlatform.WP8Player:
            GoogleMobileAd.ShowInterstitialAd();
            break;
        }
    }
コード例 #2
0
 public void ShowInterstitialAd()
 {
     if (GoogleMobileAd.IsInterstitialReady)
     {
         GoogleMobileAd.ShowInterstitialAd();
     }
 }
コード例 #3
0
 public void ShowInterstitialAd()
 {
     if (!IsMyDevice() && !scr.gM.isNoAds)
     {
         if (GoogleMobileAd.IsInterstitialReady)
         {
             GoogleMobileAd.ShowInterstitialAd();
         }
     }
 }
コード例 #4
0
    void HandleOnInterstitialLoadedGameOverBackUp()
    {
                #if STAN_ASSET_GOOGLEMOBILEADS
        GoogleMobileAd.OnInterstitialLoaded -= HandleOnInterstitialLoadedGameOverBackUp;
        GoogleMobileAd.ShowInterstitialAd();
                #endif

                #if STAN_ASSET_ANDROIDNATIVE
        AndroidAdMobController.Instance.OnInterstitialLoaded -= HandleOnInterstitialLoadedGameOverBackUp;
        AndroidAdMobController.Instance.ShowInterstitialAd();
                #endif
    }
コード例 #5
0
 public void ButtonGoToMainMenuHandler()
 {
     RS_PlayerData.Instance.AdsCD--;
     if (RS_PlayerData.Instance.AdsCD == 0)
     {
         if (GoogleMobileAd.IsInterstitialReady)
         {
             GoogleMobileAd.ShowInterstitialAd();
         }
         else
         {
             RS_PlayerData.Instance.AdsCD = 1;
         }
     }
     else
     {
         ButtonGoToMainMenuEvent();
     }
 }
コード例 #6
0
    public static void ShowInterstitialAd()
    {
        switch (Application.platform)
        {
        case RuntimePlatform.IPhonePlayer:
            if (UltimateMobileSettings.Instance.IOSAdEdngine == UM_IOSAdEngineOprions.GoogleMobileAd)
            {
                GoogleMobileAd.ShowInterstitialAd();
            }
            else
            {
                //iAdBannerController.instance.ShowInterstitialAd();
            }
            break;

        case RuntimePlatform.Android:
            if (UltimateMobileSettings.Instance.PlatformEngine == UM_PlatformDependencies.Amazon)
            {
                SA_AmazonAdsManager.Instance.ShowInterstitial();
            }
            else
            {
                GoogleMobileAd.ShowInterstitialAd();
            }
            break;

                #if UNITY_4_6 || UNITY_4_7 || UNITY_5_0 || UNITY_5_1 || UNITY_5_2
        case RuntimePlatform.WP8Player:
                #else
        case RuntimePlatform.WSAPlayerARM:
        case RuntimePlatform.WSAPlayerX64:
        case RuntimePlatform.WSAPlayerX86:
                #endif
            GoogleMobileAd.ShowInterstitialAd();
            break;
        }
    }
コード例 #7
0
    //--------------------------------------
    //  PUBLIC METHODS
    //--------------------------------------

    void OnGUI()
    {
        float StartY = 20;
        float StartX = 10;

        GUI.Label(new Rect(StartX, StartY, Screen.width, 40), "Interstisal Example", style);

        StartY += 40;
        if (GUI.Button(new Rect(StartX, StartY, 150, 50), "Start Interstitial Ad"))
        {
            GoogleMobileAd.StartInterstitialAd();
        }

        StartX += 170;
        if (GUI.Button(new Rect(StartX, StartY, 150, 50), "Load Interstitial Ad"))
        {
            GoogleMobileAd.LoadInterstitialAd();
        }


        StartX     += 170;
        GUI.enabled = IsInterstisialsAdReady;
        if (GUI.Button(new Rect(StartX, StartY, 150, 50), "Show Interstitial Ad"))
        {
            GoogleMobileAd.ShowInterstitialAd();
        }
        GUI.enabled = true;


        StartY += 80;
        StartX  = 10;
        GUI.Label(new Rect(StartX, StartY, Screen.width, 40), "Banners Example", style);

        GUI.enabled = false;
        if (banner1 == null)
        {
            GUI.enabled = true;
        }

        StartY += 40;
        if (GUI.Button(new Rect(StartX, StartY, 150, 50), "Banner Custom Pos"))
        {
            banner1 = GoogleMobileAd.CreateAdBanner(300, 100, GADBannerSize.BANNER);
        }

        StartX += 170;
        if (GUI.Button(new Rect(StartX, StartY, 150, 50), "Banner Top Left"))
        {
            banner1 = GoogleMobileAd.CreateAdBanner(TextAnchor.UpperLeft, GADBannerSize.BANNER);
        }

        StartX += 170;
        if (GUI.Button(new Rect(StartX, StartY, 150, 50), "Banner Top Center"))
        {
            banner1 = GoogleMobileAd.CreateAdBanner(TextAnchor.UpperCenter, GADBannerSize.BANNER);
        }

        StartX += 170;
        if (GUI.Button(new Rect(StartX, StartY, 150, 50), "Banner Top Right"))
        {
            banner1 = GoogleMobileAd.CreateAdBanner(TextAnchor.UpperRight, GADBannerSize.BANNER);
        }

        StartX += 170;
        if (GUI.Button(new Rect(StartX, StartY, 150, 50), "Banner Bottom Left"))
        {
            banner1 = GoogleMobileAd.CreateAdBanner(TextAnchor.LowerLeft, GADBannerSize.BANNER);
        }

        StartX += 170;
        if (GUI.Button(new Rect(StartX, StartY, 150, 50), "Banner Bottom Center"))
        {
            banner1 = GoogleMobileAd.CreateAdBanner(TextAnchor.LowerCenter, GADBannerSize.BANNER);
        }

        StartX += 170;
        if (GUI.Button(new Rect(StartX, StartY, 150, 50), "Banner Bottom Right"))
        {
            banner1 = GoogleMobileAd.CreateAdBanner(TextAnchor.LowerRight, GADBannerSize.BANNER);
        }



        GUI.enabled = false;
        if (banner1 != null)
        {
            if (banner1.IsLoaded)
            {
                GUI.enabled = true;
            }
        }


        StartY += 80;
        StartX  = 10;
        if (GUI.Button(new Rect(StartX, StartY, 150, 50), "Refresh"))
        {
            banner1.Refresh();
        }

        StartX += 170;
        if (GUI.Button(new Rect(StartX, StartY, 150, 50), "Move To Center"))
        {
            banner1.SetBannerPosition(TextAnchor.MiddleCenter);
        }

        StartX += 170;
        if (GUI.Button(new Rect(StartX, StartY, 150, 50), "To Radom Coords"))
        {
            banner1.SetBannerPosition(Random.Range(0, Screen.width), Random.Range(0, Screen.height));
        }



        GUI.enabled = false;
        if (banner1 != null)
        {
            if (banner1.IsLoaded && banner1.IsOnScreen)
            {
                GUI.enabled = true;
            }
        }
        StartX += 170;
        if (GUI.Button(new Rect(StartX, StartY, 150, 50), "Hide"))
        {
            banner1.Hide();
        }


        GUI.enabled = false;
        if (banner1 != null)
        {
            if (banner1.IsLoaded && !banner1.IsOnScreen)
            {
                GUI.enabled = true;
            }
        }
        StartX += 170;
        if (GUI.Button(new Rect(StartX, StartY, 150, 50), "Show"))
        {
            banner1.Show();
        }



        GUI.enabled = false;
        if (banner1 != null)
        {
            GUI.enabled = true;
        }
        StartX += 170;
        if (GUI.Button(new Rect(StartX, StartY, 150, 50), "Destroy"))
        {
            GoogleMobileAd.DestroyBanner(banner1.id);
            banner1 = null;
        }
        GUI.enabled = true;


        StartY += 80;
        StartX  = 10;
        GUI.Label(new Rect(StartX, StartY, Screen.width, 40), "Banner 2", style);

        GUI.enabled = false;
        if (banner2 == null)
        {
            GUI.enabled = true;
        }

        StartY += 40;
        if (GUI.Button(new Rect(StartX, StartY, 150, 50), "Smart Banner"))
        {
            banner2 = GoogleMobileAd.CreateAdBanner(TextAnchor.LowerLeft, GADBannerSize.SMART_BANNER);
        }



        GUI.enabled = false;
        if (banner2 != null)
        {
            if (banner2.IsLoaded)
            {
                GUI.enabled = true;
            }
        }

        StartX += 170;
        if (GUI.Button(new Rect(StartX, StartY, 150, 50), "Refresh"))
        {
            banner2.Refresh();
        }

        GUI.enabled = false;
        if (banner2 != null)
        {
            if (banner2.IsLoaded && banner2.IsOnScreen)
            {
                GUI.enabled = true;
            }
        }

        StartX += 170;
        if (GUI.Button(new Rect(StartX, StartY, 150, 50), "Hide"))
        {
            banner2.Hide();
        }


        GUI.enabled = false;
        if (banner2 != null)
        {
            if (banner2.IsLoaded && !banner2.IsOnScreen)
            {
                GUI.enabled = true;
            }
        }

        StartX += 170;
        if (GUI.Button(new Rect(StartX, StartY, 150, 50), "Show"))
        {
            banner2.Show();
        }

        GUI.enabled = false;
        if (banner2 != null)
        {
            GUI.enabled = true;
        }
        StartX += 170;
        if (GUI.Button(new Rect(StartX, StartY, 150, 50), "Destroy"))
        {
            GoogleMobileAd.DestroyBanner(banner2.id);
            banner2 = null;
        }

        GUI.enabled = true;
    }
コード例 #8
0
ファイル: GoogleAdsExample.cs プロジェクト: RedYellon/SSloth
    //--------------------------------------
    //  PUBLIC METHODS
    //--------------------------------------

    void OnGUI()
    {
        float StartY = 20;
        float StartX = 10;

        GUI.Label(new Rect(StartX, StartY, Screen.width, 40), "Interstisal Example", style);

        StartY += 40;
        if (GUI.Button(new Rect(StartX, StartY, 150, 50), "Start Interstitial Ad"))
        {
            GoogleMobileAd.StartInterstitialAd();
        }

        StartX += 170;
        if (GUI.Button(new Rect(StartX, StartY, 150, 50), "Load Interstitial Ad"))
        {
            GoogleMobileAd.LoadInterstitialAd();
        }


        StartX     += 170;
        GUI.enabled = IsInterstisialsAdReady;
        if (GUI.Button(new Rect(StartX, StartY, 150, 50), "Show Interstitial Ad"))
        {
            GoogleMobileAd.ShowInterstitialAd();
        }
        GUI.enabled = true;


        StartY += 80;
        StartX  = 10;
        GUI.Label(new Rect(StartX, StartY, Screen.width, 40), "Banners Example", style);

        GUI.enabled = false;
        if (banner1 == null)
        {
            GUI.enabled = true;
        }

        StartY += 40;
        if (GUI.Button(new Rect(StartX, StartY, 150, 50), "Banner Custom Pos"))
        {
            banner1 = GoogleMobileAd.CreateAdBanner(300, 100, GADBannerSize.BANNER);
        }

        StartX += 170;
        if (GUI.Button(new Rect(StartX, StartY, 150, 50), "Banner Top Left"))
        {
            banner1 = GoogleMobileAd.CreateAdBanner(TextAnchor.UpperLeft, GADBannerSize.BANNER);
        }

        StartX += 170;
        if (GUI.Button(new Rect(StartX, StartY, 150, 50), "Banner Top Center"))
        {
            banner1 = GoogleMobileAd.CreateAdBanner(TextAnchor.UpperCenter, GADBannerSize.BANNER);
        }

        StartX += 170;
        if (GUI.Button(new Rect(StartX, StartY, 150, 50), "Banner Top Right"))
        {
            banner1 = GoogleMobileAd.CreateAdBanner(TextAnchor.UpperRight, GADBannerSize.BANNER);
        }

        StartX += 170;
        if (GUI.Button(new Rect(StartX, StartY, 150, 50), "Banner Bottom Left"))
        {
            banner1 = GoogleMobileAd.CreateAdBanner(TextAnchor.LowerLeft, GADBannerSize.BANNER);
        }

        StartX += 170;
        if (GUI.Button(new Rect(StartX, StartY, 150, 50), "Banner Bottom Center"))
        {
            banner1 = GoogleMobileAd.CreateAdBanner(TextAnchor.LowerCenter, GADBannerSize.BANNER);
        }

        StartX += 170;
        if (GUI.Button(new Rect(StartX, StartY, 150, 50), "Banner Bottom Right"))
        {
            banner1 = GoogleMobileAd.CreateAdBanner(TextAnchor.LowerRight, GADBannerSize.BANNER);
        }



        GUI.enabled = false;
        if (banner1 != null)
        {
            if (banner1.IsLoaded)
            {
                GUI.enabled = true;
            }
        }


        StartY += 80;
        StartX  = 10;
        if (GUI.Button(new Rect(StartX, StartY, 150, 50), "Refresh"))
        {
            banner1.Refresh();
        }

        StartX += 170;
        if (GUI.Button(new Rect(StartX, StartY, 150, 50), "Move To Center"))
        {
            banner1.SetBannerPosition(TextAnchor.MiddleCenter);
        }

        StartX += 170;
        if (GUI.Button(new Rect(StartX, StartY, 150, 50), "To Radom Coords"))
        {
            banner1.SetBannerPosition(Random.Range(0, Screen.width), Random.Range(0, Screen.height));
        }



        GUI.enabled = false;
        if (banner1 != null)
        {
            if (banner1.IsLoaded && banner1.IsOnScreen)
            {
                GUI.enabled = true;
            }
        }
        StartX += 170;
        if (GUI.Button(new Rect(StartX, StartY, 150, 50), "Hide"))
        {
            banner1.Hide();
        }


        GUI.enabled = false;
        if (banner1 != null)
        {
            if (banner1.IsLoaded && !banner1.IsOnScreen)
            {
                GUI.enabled = true;
            }
        }
        StartX += 170;
        if (GUI.Button(new Rect(StartX, StartY, 150, 50), "Show"))
        {
            banner1.Show();
        }



        GUI.enabled = false;
        if (banner1 != null)
        {
            GUI.enabled = true;
        }
        StartX += 170;
        if (GUI.Button(new Rect(StartX, StartY, 150, 50), "Destroy"))
        {
            GoogleMobileAd.DestroyBanner(banner1.id);
            banner1 = null;
        }
        GUI.enabled = true;


        StartY += 80;
        StartX  = 10;
        GUI.Label(new Rect(StartX, StartY, Screen.width, 40), "Banner 2", style);

        GUI.enabled = false;
        if (banner2 == null)
        {
            GUI.enabled = true;
        }

        StartY += 40;
        if (GUI.Button(new Rect(StartX, StartY, 150, 50), "Smart Banner"))
        {
            banner2 = GoogleMobileAd.CreateAdBanner(TextAnchor.LowerLeft, GADBannerSize.SMART_BANNER);

            //listening for banner to load example using C# actions:
            banner2.OnLoadedAction += OnBannerLoadedAction;


            //By setting this flsg to fals we will prevent banner to show when it's loaded
            //e will listner for OnLoadedAction event and show it by our selfs instead
            banner2.ShowOnLoad = false;
        }



        GUI.enabled = false;
        if (banner2 != null)
        {
            if (banner2.IsLoaded)
            {
                GUI.enabled = true;
            }
        }

        StartX += 170;
        if (GUI.Button(new Rect(StartX, StartY, 150, 50), "Refresh"))
        {
            banner2.Refresh();
        }

        GUI.enabled = false;
        if (banner2 != null)
        {
            if (banner2.IsLoaded && banner2.IsOnScreen)
            {
                GUI.enabled = true;
            }
        }

        StartX += 170;
        if (GUI.Button(new Rect(StartX, StartY, 150, 50), "Hide"))
        {
            banner2.Hide();
        }


        GUI.enabled = false;
        if (banner2 != null)
        {
            if (banner2.IsLoaded && !banner2.IsOnScreen)
            {
                GUI.enabled = true;
            }
        }

        StartX += 170;
        if (GUI.Button(new Rect(StartX, StartY, 150, 50), "Show"))
        {
            banner2.Show();
        }

        GUI.enabled = false;
        if (banner2 != null)
        {
            GUI.enabled = true;
        }
        StartX += 170;
        if (GUI.Button(new Rect(StartX, StartY, 150, 50), "Destroy"))
        {
            GoogleMobileAd.DestroyBanner(banner2.id);
            banner2 = null;
        }

        GUI.enabled = true;
    }
コード例 #9
0
 void HandleOnInterstitialLoaded()
 {
     //ad loaded, strting ad
     GoogleMobileAd.ShowInterstitialAd();
 }
コード例 #10
0
 public void ShowInterstitialAd()
 {
     GoogleMobileAd.ShowInterstitialAd();
 }
コード例 #11
0
 private void OnInterstisialsLoaded()
 {
     //ad loaded, strting ad
     GoogleMobileAd.ShowInterstitialAd();
 }
コード例 #12
0
    private void InputFcn()
    {
        if (SceneManager.GetActiveScene().buildIndex == 1)
        {
            if (Input.GetKeyDown(KeyCode.P))
            {
                ViewWonGames();
            }

            if (Input.GetKeyDown(KeyCode.D))
            {
                PlayerPrefs.DeleteAll();
                moneyCount = 0;
                setMoney   = true;
            }

            if (Input.GetKeyDown(KeyCode.M))
            {
                moneyCount += 50000;
                setMoney    = true;
            }

            if (Input.GetKeyDown(KeyCode.Alpha1))
            {
                scr.allAw.CallAwardPanel_1();
            }
            //else if (Input.GetKeyDown(KeyCode.Alpha2))
            //    scr.allAw.CallAwardPanel_3();

            if (Input.GetKeyDown(KeyCode.C))
            {
                System.GC.Collect();
            }

            if (Input.GetKeyDown(KeyCode.Alpha0))
            {
                if (GoogleMobileAd.IsInterstitialReady)
                {
                    GoogleMobileAd.ShowInterstitialAd();
                }
            }

            if (Input.GetKeyDown(KeyCode.G))
            {
                FindObjectOfType <UnityAds_0>().ShowSimpleAd();
            }

            if (Input.GetKeyDown(KeyCode.A))
            {
                FindObjectOfType <UnityAds_0>().ShowRewardedAd();
            }
        }
        else if (SceneManager.GetActiveScene().buildIndex == 2)
        {
            if (Input.GetKeyDown(KeyCode.Alpha1))
            {
                scr.bonObjMan.BallBig(-1);
            }
            else if (Input.GetKeyDown(KeyCode.Alpha2))
            {
                scr.bonObjMan.BallBig(-2);
            }
            else if (Input.GetKeyDown(KeyCode.Alpha3))
            {
                scr.bonObjMan.BallBig(-3);
            }
            else if (Input.GetKeyDown(KeyCode.Alpha4))
            {
                scr.bonObjMan.PlayerSpeedUp(2);
            }
            else if (Input.GetKeyDown(KeyCode.Alpha5))
            {
                scr.bonObjMan.EnemySpeedUp(2);
            }
            else if (Input.GetKeyDown(KeyCode.Alpha6))
            {
                scr.bonObjMan.SetBonusPosition(BonusType.bonusType.WatchVideo);
            }

            if (Input.GetKeyDown(KeyCode.Z))
            {
                scr.timFr.TimeFreeze_StartOrStop();
            }
            else if (Input.GetKeyDown(KeyCode.X))
            {
                scr.molnia.Lightnin_OnOff();
            }
        }
    }