Beispiel #1
0
 public void ShowGameOverInterstitial()
 {
     if (Chartboost.hasCachedInterstitial())
     {
         Chartboost.showInterstitial();
     }
     else
     {
         Chartboost.cacheInterstitial();
     }
 }
    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();
    }
 // Checks for a cached an interstitial. Location is optional. Pass in null if you do not want to specify the location.
 public bool IsInterstitialCached(string location = null)
 {
     return(Chartboost.hasCachedInterstitial(location));
 }
 public bool CBIsInterstitialCached()
 {
     return(Chartboost.hasCachedInterstitial("default"));
 }
    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();
    }