コード例 #1
0
    public void ShowAd(bool force = false)
    {
        if (force)
        {
            _shown = false;
        }
        if (!_shown)
        {
            _shouldShow = true;
            Log.text    = "Shouyld show";
            if (_canShow)
            {
                Log.text = "Can show";

                if (AdMobAndroid.isInterstitalReady())
                {
                    Log.text = "Displat this shit";

                    AdMobAndroid.displayInterstital();
                    _requested = false;
                    _shown     = true;
                }
            }
        }
    }
コード例 #2
0
    public override bool?showInterstitial()
    {
        try
        {
            if (Info.IsEditor() || (firstTime && !Setup()))
            {
                return(false);
            }

                        #if UNITY_ANDROID
            if (!AdMobAndroid.isInterstitalReady())
            {
                return(false);
            }
            AdMobAndroid.displayInterstital();

            // Obtem novamente o interstitial para a proxima execucao
            AdMobAndroid.requestInterstital(inters_id);

            return(true);
                        #else
            return(false);
                        #endif
        }
        catch
        {
            return(Error(API, ERROR_TRY_SHOW_INTERSTITIAL));
        }
    }
コード例 #3
0
    public static IEnumerator showFullBanner()
    {
        yield return(null);

#if UNITY_ANDROID
        AdMobAndroid.displayInterstital();
#elif UNITY_IPHONE
        iAd.showFullBanner();
#endif
    }
コード例 #4
0
    public static IEnumerator showFullBanner()
    {
        yield return(null);

#if UNITY_ANDROID
        AdMobAndroid.displayInterstital();
#elif UNITY_IPHONE
        iAd.showFullBanner();

        ADSController.lastTimeShowedFullBanner = Time.time;

        ADSController.fullBannerLocked = false;
#endif
    }
コード例 #5
0
    void interstitialReceivedAdEvent()
    {
        if (Log)
        {
            Log.text = "interstitialReceivedAdEvent";
        }
        if (_shouldShow)
        {
            if (AdMobAndroid.isInterstitalReady())
            {
                AdMobAndroid.displayInterstital();
                _requested = false;
                _shown     = true;
            }
        }

        _canShow = true;
    }
コード例 #6
0
    // Update is called once per frame
    void Update()
    {
//		counter.text = "" ;


        if (comers.counter > 2)
        {
            AdMobAndroid.displayInterstital();

            comers.counter = 0;
        }

        var isReady = AdMobAndroid.isInterstitalReady();

        if (isReady)
        {
            //counter.text = "";
        }
    }
    void OnGUI()
    {
        beginColumn();


        if (GUILayout.Button("Init"))
        {
            AdMobAndroid.init("a14de56b4e8babd");
            //AdMobAndroid.init( "YOUR_APP_ID_HERE" );
        }


        if (GUILayout.Button("Set Test Devices"))
        {
            AdMobAndroid.setTestDevices(new string[] { "<DEVIE_ID>", "<DEVICE_ID>", "<DEVICE_ID>" });
        }


        if (GUILayout.Button("Create Smart Banner"))
        {
            // place it on the top
            AdMobAndroid.createBanner(AdMobAndroidAd.smartBanner, AdMobAdPlacement.BottomCenter);
        }


        if (GUILayout.Button("Create 320x50 banner"))
        {
            // place it on the top
            AdMobAndroid.createBanner("<BANNER_ID>", AdMobAndroidAd.phone320x50, AdMobAdPlacement.TopCenter);
        }


        if (GUILayout.Button("Create 300x250 banner"))
        {
            // center it on the top
            AdMobAndroid.createBanner(AdMobAndroidAd.tablet300x250, AdMobAdPlacement.BottomCenter);
        }


        if (GUILayout.Button("Destroy Banner"))
        {
            AdMobAndroid.destroyBanner();
        }


        endColumn(true);


        if (GUILayout.Button("Refresh Ad"))
        {
            AdMobAndroid.refreshAd();
        }


        if (GUILayout.Button("Request Interstitial"))
        {
            // replace with your adUnitId!
            AdMobAndroid.requestInterstital("INTERSTITIAL_ID");
        }


        if (GUILayout.Button("Is Interstitial Ready?"))
        {
            var isReady = AdMobAndroid.isInterstitalReady();
            Debug.Log("is interstitial ready? " + isReady);
        }


        if (GUILayout.Button("Display Interstitial"))
        {
            AdMobAndroid.displayInterstital();
        }


        if (GUILayout.Button("Hide Banner"))
        {
            AdMobAndroid.hideBanner(true);
        }


        if (GUILayout.Button("Show Banner"))
        {
            AdMobAndroid.hideBanner(false);
        }

        endColumn();
    }
コード例 #8
0
    void OnGUI()
    {
        beginColumn();


        if (GUILayout.Button("Set Test Devices"))
        {
            // replace with your test devices!
            AdMobAndroid.setTestDevices(new string[] { "6D13FA054BC989C5AC41900EE14B0C1B", "8E2F04DC5B964AFD3BC2D90396A9DA6E", "3BAB93112BBB08713B6D6D0A09EDABA1", "E2236E5E84CD318D4AD96B62B6E0EE2B" });
        }


        if (GUILayout.Button("Create Smart Banner"))
        {
            // place it on the top
            AdMobAndroid.createBanner("ca-app-pub-8386987260001674/8398905145", AdMobAndroidAd.smartBanner, AdMobAdPlacement.BottomCenter);
        }


        if (GUILayout.Button("Create 320x50 banner"))
        {
            // replace with your ad unit ID!
            AdMobAndroid.createBanner("ca-app-pub-8386987260001674/8398905145", AdMobAndroidAd.phone320x50, AdMobAdPlacement.TopCenter);
        }


        if (GUILayout.Button("Create 300x250 banner"))
        {
            // center it on the top
            AdMobAndroid.createBanner("ca-app-pub-8386987260001674/8398905145", AdMobAndroidAd.tablet300x250, AdMobAdPlacement.BottomCenter);
        }


        if (GUILayout.Button("Destroy Banner"))
        {
            AdMobAndroid.destroyBanner();
        }


        endColumn(true);


        if (GUILayout.Button("Refresh Ad"))
        {
            AdMobAndroid.refreshAd();
        }


        if (GUILayout.Button("Request Interstitial"))
        {
            // replace with your adUnitId!
            AdMobAndroid.requestInterstital("ca-app-pub-8386987260001674/9875638345");
        }


        if (GUILayout.Button("Is Interstitial Ready?"))
        {
            var isReady = AdMobAndroid.isInterstitalReady();
            Debug.Log("is interstitial ready? " + isReady);
        }


        if (GUILayout.Button("Display Interstitial"))
        {
            AdMobAndroid.displayInterstital();
        }


        if (GUILayout.Button("Hide Banner"))
        {
            AdMobAndroid.hideBanner(true);
        }


        if (GUILayout.Button("Show Banner"))
        {
            AdMobAndroid.hideBanner(false);
        }

        endColumn();
    }
コード例 #9
0
    void OnGUI()
    {
        beginColumn();


        if (GUILayout.Button("Init"))
        {
            // replace with your app ID!
            AdMobAndroid.init("ca-app-pub-3054354433122126/3944379495");
        }


        if (GUILayout.Button("Set Test Devices"))
        {
            // replace with your test devices!
            AdMobAndroid.setTestDevices(new string[] { "7CD09FA29896A51B58CDE9D4C47591B8", "8E2F04DC5B964AFD3BC2D90396A9DA6E", "F8F3B42C2CB5F2955D23FEE1A4A000FD" });
        }


        if (GUILayout.Button("Create Smart Banner"))
        {
            // place it on the top
            AdMobAndroid.createBanner(AdMobAndroidAd.smartBanner, AdMobAdPlacement.BottomCenter);
        }


        if (GUILayout.Button("Create 320x50 banner"))
        {
            // replace with your ad unit ID!
            AdMobAndroid.createBanner("ca-app-pub-3054354433122126/3944379495", AdMobAndroidAd.phone320x50, AdMobAdPlacement.TopCenter);
        }


        if (GUILayout.Button("Create 300x250 banner"))
        {
            // center it on the top
            AdMobAndroid.createBanner(AdMobAndroidAd.tablet300x250, AdMobAdPlacement.BottomCenter);
        }


        if (GUILayout.Button("Destroy Banner"))
        {
            AdMobAndroid.destroyBanner();
        }


        endColumn(true);


        if (GUILayout.Button("Refresh Ad"))
        {
            AdMobAndroid.refreshAd();
        }


        if (GUILayout.Button("Request Interstitial"))
        {
            // replace with your adUnitId!
            AdMobAndroid.requestInterstital("ca-app-pub-3054354433122126/3944379495");
        }


        if (GUILayout.Button("Is Interstitial Ready?"))
        {
            var isReady = AdMobAndroid.isInterstitalReady();
            Debug.Log("is interstitial ready? " + isReady);
        }


        if (GUILayout.Button("Display Interstitial"))
        {
            AdMobAndroid.displayInterstital();
        }


        if (GUILayout.Button("Hide Banner"))
        {
            AdMobAndroid.hideBanner(true);
        }


        if (GUILayout.Button("Show Banner"))
        {
            AdMobAndroid.hideBanner(false);
        }

        endColumn();
    }