Пример #1
0
    void Ad()
    {
        int randomNumber = Random.Range(0, 10);

        if (hide)
        {
            AdMob.destroyBanner();               //oculta banner do AdMob
#if UNITY_ANDROID
            FlurryAndroid.removeAd("main_menu"); //oculta banner do Flurry
#endif
#if UNITY_IOS
            FlurryAds.removeAdFromSpace("main_menu");               //oculta banner do Flurry
#endif
        }

        if (randomNumber <= chance)
        {
            if (banner == false && interstitial == false)
            {
                banner = true;
            }

            if (show && P31Prefs.getInt("rads") == 0)
            {
                if (banner)
                {
                    AdMob.createBanner("ca-app-pub-8470511340989148/5727361119", "ca-app-pub-8470511340989148/7343695112", AdMobBanner.SmartBanner, AdMobBannerLocation);
                }
                if (interstitial)
                {
                    ShowInterstitial(location);
                }
            }
        }
    }
Пример #2
0
    public static void Refresh()
    {
        if (P31Prefs.getInt("rads") == 3)
        {
            AdMob.destroyBanner();
#if UNITY_ANDROID
            FlurryAndroid.removeAd("main_menu");               //oculta banner do Flurry
#endif
#if UNITY_IOS
            FlurryAds.removeAdFromSpace("main_menu");
#endif
        }
    }
Пример #3
0
 public override void hideBanner()
 {
     //Debug.Log("hide flurry");
     try
     {
         if (Info.IsEditor())
         {
             //Debug.Log("return flurry");
             return;
         }
                     #if UNITY_ANDROID
         FlurryAndroid.removeAd(banner_id);
                     #elif UNITY_IPHONE
         FlurryBinding.removeAdFromSpace(banner_id);
                     #endif
     }
     catch
     {
         Error(API, ERROR_TRY_HIDE_BANNER);
     }
 }
Пример #4
0
    void OnGUI()
    {
        beginColumn();

        if (GUILayout.Button("Start Flurry Session"))
        {
            // replace with your Flurry app ID!!!
            FlurryAndroid.onStartSession("RPQYDGBDSQ7Z3DPM7XVU", true, true);
        }


        if (GUILayout.Button("Fetch Ads"))
        {
            FlurryAndroid.fetchAdsForSpace("space", FlurryAdPlacement.BannerBottom);
            FlurryAndroid.fetchAdsForSpace("bigAd", FlurryAdPlacement.FullScreen);
        }


        if (GUILayout.Button("Display Ad"))
        {
            FlurryAndroid.displayAd("space", FlurryAdPlacement.BannerBottom, 1000);
        }


        if (GUILayout.Button("Display bigAd Ad"))
        {
            FlurryAndroid.displayAd("bigAd", FlurryAdPlacement.FullScreen, 1000);
        }


        if (GUILayout.Button("Remove Ad"))
        {
            FlurryAndroid.removeAd("space");
        }


        endColumn(true);


        if (GUILayout.Button("Log Timed Event"))
        {
            FlurryAndroid.logEvent("timed", true);
        }


        if (GUILayout.Button("End Timed Event"))
        {
            FlurryAndroid.endTimedEvent("timed");
        }


        if (GUILayout.Button("Log Event"))
        {
            FlurryAndroid.logEvent("myFancyEvent");
        }


        if (GUILayout.Button("Log Event with Params"))
        {
            var dict = new Dictionary <string, string>();
            dict.Add("akey1", "value1");
            dict.Add("bkey2", "value2");
            dict.Add("ckey3", "value3");
            dict.Add("dkey4", "value4");

            FlurryAndroid.logEvent("EventWithParams", dict);
        }


        if (GUILayout.Button("Log Page View"))
        {
            FlurryAndroid.onPageView();
        }


        if (GUILayout.Button("Log Error"))
        {
            FlurryAndroid.onError("666", "bad things happend", "Exception");
        }

        endColumn();
    }