コード例 #1
0
 public void ShowGameOverRewardedVideo()
 {
     if (Chartboost.hasCachedRewardedVideo())
     {
         Chartboost.showRewardedVideo();
     }
     else
     {
         Chartboost.cacheRewardedVideo();
     }
 }
コード例 #2
0
    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();
    }