示例#1
0
 public void ShowInterstitialCharboostMoreGames()
 {
             #if UNITY_IPHONE
     Chartboost.showMoreApps(CBLocation.Default);
     Chartboost.cacheMoreApps(CBLocation.Default);
             #endif
 }
示例#2
0
    // Use this for initialization
    void Start()
    {
        audioIsOff = PlayerPrefs.GetInt("audioisoff");
        if (audioIsOff == 0)
        {
            // set audio ON
            soundButtonOFF.SetActive(false);
            soundButtonON.SetActive(true);
        }
        else
        {
            // set audio ON
            soundButtonOFF.SetActive(true);
            soundButtonON.SetActive(false);
        }

        PlayerPrefs.SetString("leaderboardid", LEADERBOARD_ID);
        PlayerPrefs.SetString("twittertext", TWITTER_MESSAGE);
        PlayerPrefs.SetString("admobbannerid", ADMOB_BANNER_ID);
        PlayerPrefs.SetString("INAPP_PURCHASE_REMOVE_ADS", INAPP_PURCHASE_REMOVE_ADS);
        Social.localUser.Authenticate(ProcessAuthentication);


        PlayBackgroundMusic();

        Chartboost.didFailToLoadMoreApps += didFailToLoadMoreApps;
        Chartboost.didDismissMoreApps    += didDismissMoreApps;
        Chartboost.didCloseMoreApps      += didCloseMoreApps;
        Chartboost.didClickMoreApps      += didClickMoreApps;
        Chartboost.didCacheMoreApps      += didCacheMoreApps;
        Chartboost.shouldDisplayMoreApps += shouldDisplayMoreApps;
        Chartboost.didDisplayMoreApps    += didDisplayMoreApps;
        Chartboost.cacheMoreApps(CBLocation.HomeScreen);

        AdsRemoved = PlayerPrefs.GetInt("adsremoved") == 1;
        if (AdsRemoved)
        {
            HideAdsButton();
        }
        else
        {
            RequestBanner();
        }

        StoreEvents.OnMarketItemsRefreshFailed    += storeRefreshFailed;
        StoreEvents.OnMarketPurchase              += onMarketPurchase;
        StoreEvents.OnItemPurchased               += onItemPurchased;
        StoreEvents.OnRestoreTransactionsFinished += onRestoreTransactionsFinished;
        SoomlaStore.Initialize(new GameAssets());
    }
示例#3
0
    void OnGUI()
    {
        beginColumn();


        if (GUILayout.Button("Init"))
        {
            Chartboost.init("ANDROID_APP_ID", "ANDROID_APP_SIGNATURE", "IOS_APP_ID", "IOS_APP_SIGNATURE");
        }


        if (GUILayout.Button("Cache Interstitial"))
        {
            Chartboost.cacheInterstitial("default");
        }


        if (GUILayout.Button("Is Interstitial Cached?"))
        {
            Debug.Log("is cached: " + Chartboost.hasCachedInterstitial("default"));
        }


        if (GUILayout.Button("Show Interstitial"))
        {
            Chartboost.showInterstitial("default");
        }


        if (GUILayout.Button("Cache More Apps"))
        {
            Chartboost.cacheMoreApps();
        }


        if (GUILayout.Button("Show More Apps"))
        {
            Chartboost.showMoreApps();
        }


        if (GUILayout.Button("Track Event with Value and Metadata"))
        {
            var dict = new Dictionary <string, object>();
            dict.Add("key", "theValue");
            Chartboost.trackEvent("event_with_value_and_data", 9809823, dict);
        }

        endColumn();
    }
示例#4
0
    public void CacheAd(AdNetwork network, DisplayedAdType displayType, CBLocation location)
    {
#if ADFREE
        // Don't cache if Ad-free
        return;
#endif

        if (Debug.isDebugBuild)
        {
            Debug.Log("Caching ad");
        }

        switch (displayType)
        {
        case DisplayedAdType.FullScreen:

#if !MOREAPPSONLY
            switch (network)
            {
            case AdNetwork.ChartBoost:
            default:
                Chartboost.cacheInterstitial(location);
                break;
            }
#endif

            break;

        case DisplayedAdType.MoreGames:
            switch (network)
            {
            case AdNetwork.ChartBoost:
            default:
                Chartboost.cacheMoreApps(location);
                break;
            }
            break;

        case DisplayedAdType.Video:
            switch (network)
            {
            case AdNetwork.ChartBoost:
            default:
                Chartboost.cacheRewardedVideo(location);
                break;
            }
            break;
        }
    }
示例#5
0
    private void initPlugins()
    {
        Chartboost.CreateWithAppId("CHARTBOOST_APP_ID_IOS", "CHARTBOOST_APP_SIGNATURE_IOS");

        Chartboost.cacheMoreApps(CBLocation.Default);
        Chartboost.cacheRewardedVideo(CBLocation.locationFromName("Video Interstitial"));
        Chartboost.cacheInterstitial(CBLocation.locationFromName("Video Interstitial"));
        Chartboost.cacheInterstitial(CBLocation.locationFromName("Static Interstitial"));
        Chartboost.cacheInterstitial(CBLocation.Default);


        if (Advertisement.isSupported)                                                         // If runtime platform is supported...
        {
            Advertisement.Initialize(GameConfig.UNITY_ADS_ID, GameConfig.UNITY_ADS_TEST_MODE); // ...initialize.
        }

        _isInitialized = true;
    }
示例#6
0
    // Use this for initialization


    void Start()
    {
        Chartboost.setAutoCacheAds(true);


        Chartboost.cacheInterstitial(CBLocation.Default);
        Chartboost.cacheInterstitial(CBLocation.HomeScreen);
        Chartboost.cacheInterstitial(CBLocation.Quit);
        Chartboost.cacheRewardedVideo(CBLocation.Default);
        Chartboost.cacheMoreApps(CBLocation.Default);
        Chartboost.cacheMoreApps(CBLocation.Settings);

        Chartboost.didDismissRewardedVideo    += Chartboost_didDismissRewardedVideo;
        Chartboost.didCompleteRewardedVideo   += Chartboost_didCompleteRewardedVideo;
        Chartboost.didFailToLoadRewardedVideo += Chartboost_didFailToLoadRewardedVideo;
        Chartboost.didDisplayRewardedVideo    += Chartboost_didDisplayRewardedVideo;
        Chartboost.didFailToLoadMoreApps      += Chartboost_didFailToLoadMoreApps;
        Chartboost.didCacheMoreApps           += Chartboost_didCacheMoreApps;

        Chartboost.didCloseInterstitial += Chartboost_didCloseInterstitial;
        // Chartboost.showInterstitial(CBLocation.HomeScreen);
        //Chartboost.showRewardedVideo(CBLocation.Default);
    }
 // Caches the more apps screen
 public void  CacheMoreApps()
 {
     Chartboost.cacheMoreApps();
 }
示例#8
0
 public void chartboostCacheMoreApps(CBLocation location)
 {
     Chartboost.cacheMoreApps(location);
 }
    void OnGUI()
    {
/*
 #if UNITY_ANDROID
 *              // Disable user input for GUI when impressions are visible
 *              // This is only necessary on Android if we have disabled impression activities
 *              //   by having called CBBinding.init(ID, SIG, false), as that allows touch
 *              //   events to leak through Chartboost impressions
 *              GUI.enabled = !Chartboost.isImpressionVisible();
 #endif
 */
        GUI.matrix = Matrix4x4.Scale(new Vector3(5, 5, 5));

        if (GUILayout.Button("Cache Interstitial"))
        {
            Chartboost.cacheInterstitial(CBLocation.Default);
        }

        if (GUILayout.Button("Show Interstitial"))
        {
            Chartboost.showInterstitial(CBLocation.Default);
        }

        if (GUILayout.Button("Cache More Apps"))
        {
            Chartboost.cacheMoreApps(CBLocation.Default);
        }

        if (GUILayout.Button("Show More Apps"))
        {
            Chartboost.showMoreApps(CBLocation.Default);
        }

        if (GUILayout.Button("Cache Rewarded Video"))
        {
            Chartboost.cacheRewardedVideo(CBLocation.Default);
        }

        if (GUILayout.Button("Show Rewarded Video"))
        {
            Chartboost.showRewardedVideo(CBLocation.Default);
        }

        if (GUILayout.Button("Cache InPlay Ad"))
        {
            Chartboost.cacheInPlay(CBLocation.Default);
        }

        if (GUILayout.Button("Show InPlay Ad"))
        {
            inPlayAd = Chartboost.getInPlay(CBLocation.Default);
            if (inPlayAd != null)
            {
                // Set the texture of InPlay Ad Icon
                // Link its onClick() event with inPlay's click()
                inPlayIcon.guiTexture.texture = inPlayAd.appIcon;
                inPlayText.guiText.text       = inPlayAd.appName;
                inPlayAd.show();
            }
        }
    }
示例#10
0
    void LayoutButtons()
    {
        // The view with buttons to trigger the main Chartboost API calls
        GUILayout.Space(5);
        GUILayout.Label("Has Interstitial: " + hasInterstitial);

        if (GUILayout.Button("Cache Interstitial", GUILayout.Width(ELEMENT_WIDTH)))
        {
            Chartboost.cacheInterstitial(CBLocation.Default);
        }

        if (GUILayout.Button("Show Interstitial", GUILayout.Width(ELEMENT_WIDTH)))
        {
            Chartboost.showInterstitial(CBLocation.Default);
        }

        GUILayout.Space(5);
        GUILayout.Label("Has MoreApps: " + hasMoreApps);
        if (GUILayout.Button("Cache More Apps", GUILayout.Width(ELEMENT_WIDTH)))
        {
            Chartboost.cacheMoreApps(CBLocation.Default);
        }

        if (GUILayout.Button("Show More Apps", GUILayout.Width(ELEMENT_WIDTH)))
        {
            Chartboost.showMoreApps(CBLocation.Default);
        }

        GUILayout.Space(5);
        GUILayout.Label("Has Rewarded Video: " + hasRewardedVideo);
        if (GUILayout.Button("Cache Rewarded Video", GUILayout.Width(ELEMENT_WIDTH)))
        {
            Chartboost.cacheRewardedVideo(CBLocation.Default);
        }

        if (GUILayout.Button("Show Rewarded Video", GUILayout.Width(ELEMENT_WIDTH)))
        {
            Chartboost.showRewardedVideo(CBLocation.Default);
        }

        GUILayout.Space(5);
        GUILayout.Label("Has InPlay: " + hasInPlay);
        if (GUILayout.Button("Cache InPlay Ad", GUILayout.Width(ELEMENT_WIDTH)))
        {
            Chartboost.cacheInPlay(CBLocation.Default);
        }

        if (GUILayout.Button("Show InPlay Ad", GUILayout.Width(ELEMENT_WIDTH)))
        {
            inPlayAd = Chartboost.getInPlay(CBLocation.Default);
            if (inPlayAd != null)
            {
                inPlayAd.show();
            }
        }
        if (inPlayAd != null)
        {
            // Set the texture of InPlay Ad Icon
            // Link its onClick() event with inPlay's click()
            GUILayout.Label("app: " + inPlayAd.appName);
            if (GUILayout.Button(inPlayAd.appIcon, GUILayout.Width(ELEMENT_WIDTH)))
            {
                inPlayAd.click();
            }
        }

        GUILayout.Space(5);
        GUILayout.Label("Post install events:");
        if (GUILayout.Button("Send PIA Main Level Event", GUILayout.Width(ELEMENT_WIDTH)))
        {
            Chartboost.trackLevelInfo("Test Data", CBLevelType.HIGHEST_LEVEL_REACHED, 1, "Test Send mail level Information");
        }

        if (GUILayout.Button("Send PIA Sub Level Event", GUILayout.Width(ELEMENT_WIDTH)))
        {
            Chartboost.trackLevelInfo("Test Data", CBLevelType.HIGHEST_LEVEL_REACHED, 1, 2, "Test Send sub level Information");
        }

        if (GUILayout.Button("Track IAP", GUILayout.Width(ELEMENT_WIDTH)))
        {
            TrackIAP();
        }
    }
 // Token: 0x06000014 RID: 20 RVA: 0x00002B58 File Offset: 0x00000F58
 private void LayoutButtons()
 {
     GUILayout.Space(5f);
     GUILayout.Label("Has Interstitial: " + this.hasInterstitial, new GUILayoutOption[0]);
     if (GUILayout.Button("Cache Interstitial", new GUILayoutOption[]
     {
         GUILayout.Width((float)this.ELEMENT_WIDTH)
     }))
     {
         Chartboost.cacheInterstitial(CBLocation.Default);
     }
     if (GUILayout.Button("Show Interstitial", new GUILayoutOption[]
     {
         GUILayout.Width((float)this.ELEMENT_WIDTH)
     }))
     {
         Chartboost.showInterstitial(CBLocation.Default);
     }
     GUILayout.Space(5f);
     GUILayout.Label("Has MoreApps: " + this.hasMoreApps, new GUILayoutOption[0]);
     if (GUILayout.Button("Cache More Apps", new GUILayoutOption[]
     {
         GUILayout.Width((float)this.ELEMENT_WIDTH)
     }))
     {
         Chartboost.cacheMoreApps(CBLocation.Default);
     }
     if (GUILayout.Button("Show More Apps", new GUILayoutOption[]
     {
         GUILayout.Width((float)this.ELEMENT_WIDTH)
     }))
     {
         Chartboost.showMoreApps(CBLocation.Default);
     }
     GUILayout.Space(5f);
     GUILayout.Label("Has Rewarded Video: " + this.hasRewardedVideo, new GUILayoutOption[0]);
     if (GUILayout.Button("Cache Rewarded Video", new GUILayoutOption[]
     {
         GUILayout.Width((float)this.ELEMENT_WIDTH)
     }))
     {
         Chartboost.cacheRewardedVideo(CBLocation.Default);
     }
     if (GUILayout.Button("Show Rewarded Video", new GUILayoutOption[]
     {
         GUILayout.Width((float)this.ELEMENT_WIDTH)
     }))
     {
         Chartboost.showRewardedVideo(CBLocation.Default);
     }
     GUILayout.Space(5f);
     GUILayout.Label("Has InPlay: " + this.hasInPlay, new GUILayoutOption[0]);
     if (GUILayout.Button("Cache InPlay Ad", new GUILayoutOption[]
     {
         GUILayout.Width((float)this.ELEMENT_WIDTH)
     }))
     {
         Chartboost.cacheInPlay(CBLocation.Default);
     }
     if (GUILayout.Button("Show InPlay Ad", new GUILayoutOption[]
     {
         GUILayout.Width((float)this.ELEMENT_WIDTH)
     }))
     {
         this.inPlayAd = Chartboost.getInPlay(CBLocation.Default);
         if (this.inPlayAd != null)
         {
             this.inPlayAd.show();
         }
     }
     if (this.inPlayAd != null)
     {
         GUILayout.Label("app: " + this.inPlayAd.appName, new GUILayoutOption[0]);
         if (GUILayout.Button(this.inPlayAd.appIcon, new GUILayoutOption[]
         {
             GUILayout.Width((float)this.ELEMENT_WIDTH)
         }))
         {
             this.inPlayAd.click();
         }
     }
     GUILayout.Space(5f);
     GUILayout.Label("Post install events:", new GUILayoutOption[0]);
     if (GUILayout.Button("Send PIA Main Level Event", new GUILayoutOption[]
     {
         GUILayout.Width((float)this.ELEMENT_WIDTH)
     }))
     {
         Chartboost.trackLevelInfo("Test Data", CBLevelType.HIGHEST_LEVEL_REACHED, 1, "Test Send mail level Information");
     }
     if (GUILayout.Button("Send PIA Sub Level Event", new GUILayoutOption[]
     {
         GUILayout.Width((float)this.ELEMENT_WIDTH)
     }))
     {
         Chartboost.trackLevelInfo("Test Data", CBLevelType.HIGHEST_LEVEL_REACHED, 1, 2, "Test Send sub level Information");
     }
     if (GUILayout.Button("Track IAP", new GUILayoutOption[]
     {
         GUILayout.Width((float)this.ELEMENT_WIDTH)
     }))
     {
         this.TrackIAP();
     }
 }
示例#12
0
 public static void cacheMore()
 {
     Chartboost.cacheMoreApps(CBLocation.Default);
 }
    void OnGUI()
    {
/*
 #if UNITY_ANDROID
 *              // Disable user input for GUI when impressions are visible
 *              // This is only necessary on Android if we have disabled impression activities
 *              //   by having called CBBinding.init(ID, SIG, false), as that allows touch
 *              //   events to leak through Chartboost impressions
 *              GUI.enabled = !Chartboost.isImpressionVisible();
 #endif
 */
        scrollPosition = GUI.BeginScrollView(new Rect(0, 0, UnityEngine.Screen.width, UnityEngine.Screen.height - 50), scrollPosition, new Rect(0, 0, UnityEngine.Screen.width - 50, UnityEngine.Screen.height));

        GUI.matrix = Matrix4x4.Scale(new Vector3(3, 3, 3));

        if (GUILayout.Button("Cache Interstitial"))
        {
            Chartboost.cacheInterstitial(CBLocation.GameOver);
        }

        if (GUILayout.Button("Show Interstitial"))
        {
            Chartboost.showInterstitial(CBLocation.GameOver);
        }

        if (GUILayout.Button("Cache More Apps"))
        {
            Chartboost.cacheMoreApps(CBLocation.Default);
        }

        if (GUILayout.Button("Show More Apps"))
        {
            Chartboost.showMoreApps(CBLocation.Default);
        }

        if (GUILayout.Button("Cache Rewarded Video"))
        {
            Chartboost.cacheRewardedVideo(CBLocation.Default);
        }

        if (GUILayout.Button("Show Rewarded Video"))
        {
            Chartboost.showRewardedVideo(CBLocation.Default);
        }

        if (GUILayout.Button("Cache InPlay Ad"))
        {
            Chartboost.cacheInPlay(CBLocation.Default);
        }

        if (GUILayout.Button("Show InPlay Ad"))
        {
            inPlayAd = Chartboost.getInPlay(CBLocation.Default);
            if (inPlayAd != null)
            {
                // Set the texture of InPlay Ad Icon
                // Link its onClick() event with inPlay's click()
                inPlayIcon.GetComponent <GUITexture>().texture = inPlayAd.appIcon;
                inPlayText.GetComponent <GUIText>().text       = inPlayAd.appName;
                inPlayAd.show();
            }
        }

        if (GUILayout.Button("Send PIA Main Level Event"))
        {
            Chartboost.trackLevelInfo("Test Data", CBLevelType.HIGHEST_LEVEL_REACHED, 1, "Test Send mail level Informatoion");
        }

        if (GUILayout.Button("Send PIA Sub Level Event"))
        {
            Chartboost.trackLevelInfo("Test Data", CBLevelType.HIGHEST_LEVEL_REACHED, 1, 2, "Test Send sub level Informatoion");
        }

                #if UNITY_IPHONE
        if (GUILayout.Button("Track IAP"))
        {
            TrackIAP();
        }
                #endif

        GUI.EndScrollView();
    }
    void OnGUI()
    {
        beginColumn();

        if (GUILayout.Button("Init"))
        {
            // Replace with your app IDs and app signatures!!!
            Chartboost.init("4f7b433509b6025804000002", "dd2d41b69ac01b80f443f5b6cf06096d457f82bd", "4eed78896d9619a066000096", "c885a2a0615a1c5acb6c6f207dea3a38972bf0ec");
        }


        if (GUILayout.Button("Cache Interstitial"))
        {
            Chartboost.cacheInterstitial("Startup");
        }


        if (GUILayout.Button("Is Interstitial Cached?"))
        {
            Debug.Log("is cached: " + Chartboost.hasCachedInterstitial("Startup"));
        }


        if (GUILayout.Button("Show Interstitial"))
        {
            Chartboost.showInterstitial("Startup");
        }


        if (GUILayout.Button("Cache More Apps"))
        {
            Chartboost.cacheMoreApps("MoApps");
        }


        if (GUILayout.Button("Has Cached More Apps"))
        {
            Debug.Log("has cached more apps: " + Chartboost.hasCachedMoreApps("Startup"));
        }


        if (GUILayout.Button("Show More Apps"))
        {
            Chartboost.showMoreApps("MoApps");
        }

        endColumn(true);


        if (GUILayout.Button("Cache Rewarded Video"))
        {
            Chartboost.cacheRewardedVideo("VideoSpot");
        }


        if (GUILayout.Button("Has Cached Rewarded Video"))
        {
            Debug.Log("has cached rewarded video: " + Chartboost.hasCachedRewardedVideo("VideoSpot"));
        }


        if (GUILayout.Button("Show Rewarded Video"))
        {
            Chartboost.showRewardedVideo("VideoSpot");
        }

        endColumn();
    }
    void OnGUI()
    {
                #if TESTMODE_CHARTBOOST
        /*
         #if UNITY_ANDROID
         * // Disable user input for GUI when impressions are visible
         * // This is only necessary on Android if we have disabled impression activities
         * //   by having called CBBinding.init(ID, SIG, false), as that allows touch
         * //   events to leak through Chartboost impressions
         * GUI.enabled = !Chartboost.isImpressionVisible();
         #endif
         */
        GUI.matrix = Matrix4x4.Scale(new Vector3(2, 2, 2));

        if (GUILayout.Button("Init Chatboost"))
        {
                        #if UNITY_IOS
            Chartboost.init("54ca1abf04b0163ff3221c8d", "c232af7185297173942d04877791032505ec4c08");
                        #elif UNITY_ANDROID
            Chartboost.init("54ca2d4cc909a67eaaad9bad", "c85f8a761c7e159ddfcdc37f0e96141a65a1ad8a");
                        #endif
        }

        if (GUILayout.Button("Cache Interstitial"))
        {
            Chartboost.cacheInterstitial(CBLocation.Default);
        }

        if (GUILayout.Button("Show Interstitial"))
        {
            if (Chartboost.hasInterstitial(CBLocation.Default))
            {
                Chartboost.showInterstitial(CBLocation.Default);
                //Invoke("randShow", 0.1f);
            }
            else
            {
                Debug.Log("Interstitial ad has not cached yet");
            }
        }

        if (GUILayout.Button("Cache More Apps"))
        {
            Chartboost.cacheMoreApps(CBLocation.Default);
        }

        if (GUILayout.Button("Show More Apps"))
        {
            if (Chartboost.hasMoreApps(CBLocation.Default))
            {
                Chartboost.showMoreApps(CBLocation.Default);
                //Invoke("randShow", 0.1f);
            }
            else
            {
                Debug.Log("Moreapps has not cached yet");
            }
        }

        if (GUILayout.Button("Cache Rewarded Video"))
        {
            Chartboost.cacheRewardedVideo(CBLocation.Default);
        }

        if (GUILayout.Button("Show Rewarded Video"))
        {
            if (Chartboost.hasRewardedVideo(CBLocation.Default))
            {
                Chartboost.showRewardedVideo(CBLocation.Default);
                //Invoke("randShow", 0.1f);
            }
            else
            {
                Debug.Log("Reward video ad has not cached yet");
            }
        }

        if (GUILayout.Button("Cache InPlay Ad"))
        {
            Chartboost.cacheInPlay(CBLocation.Default);
        }

        if (GUILayout.Button("Show InPlay Ad"))
        {
            if (Chartboost.hasInPlay(CBLocation.Default))
            {
                inPlayAd = Chartboost.getInPlay(CBLocation.Default);
                if (inPlayAd != null)
                {
                    // Set the texture of InPlay Ad Icon
                    // Link its onClick() event with inPlay's click()
                    inPlayIcon.guiTexture.texture = inPlayAd.appIcon;
                    inPlayText.guiText.text       = inPlayAd.appName;
                    inPlayAd.show();
                }
            }
            else
            {
                Debug.Log("InPlayAd has not cached yet");
            }
        }
                #endif
    }