Beispiel #1
0
    public static void LoadInterstitialAd()
    {
        switch (Application.platform)
        {
        case RuntimePlatform.IPhonePlayer:

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

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

        case RuntimePlatform.WP8Player:
            GoogleMobileAd.LoadInterstitialAd();
            break;
        }
    }
    void Start()
    {
        GoogleMobileAd.Init();

        GoogleMobileAd.OnInterstitialLoaded += HandleOnInterstitialLoaded;
        GoogleMobileAd.OnInterstitialClosed += OnInterstisialsClosed;
        GoogleMobileAd.OnInterstitialOpened += OnInterstisialsOpen;


        //loadin ad:
        GoogleMobileAd.LoadInterstitialAd();
    }
    void Start()
    {
        GoogleMobileAd.Init();


        GoogleMobileAd.controller.addEventListener(GoogleMobileAdEvents.ON_INTERSTITIAL_AD_LOADED, OnInterstisialsLoaded);
        GoogleMobileAd.controller.addEventListener(GoogleMobileAdEvents.ON_INTERSTITIAL_AD_OPENED, OnInterstisialsOpen);

        GoogleMobileAd.controller.addEventListener(GoogleMobileAdEvents.ON_INTERSTITIAL_AD_CLOSED, OnInterstisialsClosed);

        //loadin ad:
        GoogleMobileAd.LoadInterstitialAd();
    }
Beispiel #4
0
    void ShowAdmobBackup()
    {
                #if STAN_ASSET_GOOGLEMOBILEADS
        GoogleMobileAd.OnInterstitialLoaded -= HandleOnInterstitialLoadedGameOverBackUp;

        GoogleMobileAd.LoadInterstitialAd();
                #endif

                #if STAN_ASSET_ANDROIDNATIVE
        AndroidAdMobController.Instance.OnInterstitialLoaded -= HandleOnInterstitialLoadedGameOverBackUp;

        AndroidAdMobController.Instance.LoadInterstitialAd();
                #endif
    }
Beispiel #5
0
    void Start()
    {
        Tickets.text = RS_PlayerData.Instance.MultiplayerTickets.ToString() + "/" + RS_PlayerData.MAX_TICKETS.ToString();
        Wins.text    = RS_PlayerData.Instance.MultiplayerWins.ToString();

        if (UM_GameServiceManager.Instance.ConnectionSate == UM_ConnectionState.CONNECTED)
        {
            PlayerName.text = UM_GameServiceManager.Instance.Player.Name;
            LoadPlayerAvatar();
        }
        else
        {
            UM_GameServiceManager.OnPlayerConnected += HandleOnPlayerConnected;
        }

        if (!GoogleMobileAd.IsInited)
        {
            GoogleMobileAd.Init();
            GoogleMobileAd.LoadInterstitialAd();
        }
    }
Beispiel #6
0
    public static void LoadInterstitialAd()
    {
        switch (Application.platform)
        {
        case RuntimePlatform.IPhonePlayer:

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

        case RuntimePlatform.Android:
            if (UltimateMobileSettings.Instance.PlatformEngine == UM_PlatformDependencies.Amazon)
            {
                SA_AmazonAdsManager.Instance.LoadInterstitial();
            }
            else
            {
                GoogleMobileAd.LoadInterstitialAd();
            }
            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.LoadInterstitialAd();
            break;
        }
    }
Beispiel #7
0
    /// <summary>
    /// Show admob or iAd (if iOS) interstitial
    /// </summary>
    public void ShowAdmobInterstitialGameOver()
    {
                #if UNITY_IOS
                #if STAN_ASSET_GOOGLEMOBILEADS || STAN_ASSET_ANDROIDNATIVE || GOOGLE_MOBILE_ADS
        if (!useAdmob)
        {
                #endif
        WantToShowAD();
                #if STAN_ASSET_GOOGLEMOBILEADS || STAN_ASSET_ANDROIDNATIVE || GOOGLE_MOBILE_ADS
    }
                #endif
                #endif


                #if GOOGLE_MOBILE_ADS
                #if UNITY_IOS
        if (useAdmob)
        {
                #endif
        if (Application.isMobilePlatform && interstitial.IsLoaded())
        {
            interstitial.Show();
        }
        else
        {
            RequestInterstitial();
        }
                #if UNITY_IOS
    }
                #endif
                #endif

                #if STAN_ASSET_GOOGLEMOBILEADS
                #if UNITY_IOS
        if (useAdmob)
        {
                #endif
        GoogleMobileAd.OnInterstitialLoaded -= HandleOnInterstitialLoadedGameOver;

        GoogleMobileAd.OnInterstitialFailedLoading -= HandleOnInterstitialFailedLoadingGameOver;

        GoogleMobileAd.OnInterstitialLoaded += HandleOnInterstitialLoadedGameOver;

        GoogleMobileAd.OnInterstitialFailedLoading += HandleOnInterstitialFailedLoadingGameOver;

        GoogleMobileAd.LoadInterstitialAd();
                #if UNITY_IOS
    }
                #endif
                #endif

                #if STAN_ASSET_ANDROIDNATIVE
                #if UNITY_IOS
        if (useAdmob)
        {
                #endif
        AndroidAdMobController.Instance.OnInterstitialLoaded -= HandleOnInterstitialLoadedGameOver;

        AndroidAdMobController.Instance.OnInterstitialFailedLoading -= HandleOnInterstitialFailedLoadingGameOver;

        AndroidAdMobController.Instance.OnInterstitialLoaded += HandleOnInterstitialLoadedGameOver;

        AndroidAdMobController.Instance.OnInterstitialFailedLoading += HandleOnInterstitialFailedLoadingGameOver;

        AndroidAdMobController.Instance.LoadInterstitialAd();
                #if UNITY_IOS
    }
                #endif
                #endif
    }
Beispiel #8
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;
    }
Beispiel #9
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);

            //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;
    }
 public void LoadInterstitialAd()
 {
     GoogleMobileAd.LoadInterstitialAd();
 }
Beispiel #11
0
 public void LoadNewIntertitialBanner()
 {
     GoogleMobileAd.LoadInterstitialAd();
 }
 void GoogleMobileAd_OnInterstitialClosed()
 {
     GoogleMobileAd.LoadInterstitialAd();
     ButtonGoToMainMenuEvent();
 }
Beispiel #13
0
 private void GoogleMobileAd_OnInterstitialClosed()
 {
     GoogleMobileAd.LoadInterstitialAd();
 }