コード例 #1
0
    public override void OnEvent(string EventName, GameObject Sender)
    {
        base.OnEvent(EventName, Sender);

        if (EventName == "LevelSelected")
        {
            LevelControl.CurrentLevel = int.Parse(Sender.GetComponentInChildren <Text>().text) - 1;
            UIRoot.I.GetView <LoadingView>().SetVisible(true);
            AdMobAndroid.hideBanner(true);
            AppRoot.I.SetState(new PlayState(false, true), false);
            StateMainMenu.ShouldShowMenuAd = true;
        }
        if (EventName == "SelectLeft")
        {
            SelectFirstPart();
        }
        if (EventName == "SelectRight")
        {
            SelectSecondPart();
        }
        if (EventName == "BackPressed")
        {
            AppRoot.I.SetState(new StateMainMenu());
        }
    }
コード例 #2
0
    public static IEnumerator hideBanner()
    {
        yield return(null);

#if UNITY_ANDROID
        AdMobAndroid.hideBanner(true);
#elif UNITY_IPHONE
        iAd.showBanner(false);
#endif
    }
コード例 #3
0
 public override void hideBanner()
 {
     //Debug.Log("hide admob");
     try
     {
         if (Info.IsEditor() || (firstTime && !Setup()))
         {
             //Debug.Log("return admob");
             return;
         }
                     #if UNITY_ANDROID
         AdMobAndroid.hideBanner(true);
                     #endif
     }
     catch
     {
         Error(API, ERROR_TRY_HIDE_BANNER);
     }
 }
コード例 #4
0
    protected override void OnActivate()
    {
        base.OnActivate();

        EventController.I.Subscribe("PlayPressed", this);
        EventController.I.Subscribe("MoreGames", this);

        UIRoot.I.GetView <MainMenuView>().SetVisible(true);

        if (ShouldShowMenuAd)
        {
            AdMobAndroidEventListener.Instance.Request();
            AdMobAndroidEventListener.Instance.DontShow();
            ShouldShowMenuAd = false;
        }
        AdMobAndroid.hideBanner(false);

        GA.I.LogScreen("Main Menu");
    }
    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();
    }
コード例 #6
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();
    }
コード例 #7
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();
    }