Beispiel #1
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;
        }
    }
 bool shouldDisplayMoreApps(CBLocation location)
 {
     return showMoreApps;
 }
 void didFailToRecordClick(CBLocation location, CBClickError error)
 {
 }
Beispiel #4
0
 /// <summary>
 /// Determine if a locally cached interstitial exists for the given CBLocation.
 /// A return value of true here indicates that the corresponding
 /// showInterstitial:(CBLocation)location method will present without making
 ///	additional Chartboost API server requests to fetch data to present.
 /// </summary>
 /// <returns>true if the interstitial is cached, false if not.</returns>
 /// <param name="location">The location for the Chartboost impression type.</param>
 public static bool hasInterstitial(CBLocation location)
 {
     return(CBExternal.hasInterstitial(location));
 }
	void didCacheInPlay(CBLocation location) {
		AddLog("didCacheInPlay called: "+location);
	}
	void didCacheRewardedVideo(CBLocation location) {
		AddLog("didCacheRewardedVideo: " + location);
	}
	bool shouldDisplayMoreApps(CBLocation location) {
		AddLog(string.Format("shouldDisplayMoreApps at location: {0}: {1}", location, showMoreApps));
		return showMoreApps;
	}
	void didCacheInterstitial(CBLocation location) {
		AddLog("didCacheInterstitial: " + location);
	}
Beispiel #9
0
 /// <summary>
 /// Determine if a locally cached rewarded video exists for the given CBLocation.
 /// A return value of true here indicates that the corresponding
 /// showRewardedVideo:(CBLocation)location method will present without making
 ///	additional Chartboost API server requests to fetch data to present.
 /// </summary>
 /// <returns>true if the rewarded video is cached, false if not.</returns>
 /// <param name="location">The location for the Chartboost impression type.</param>
 public static bool hasRewardedVideo(CBLocation location)
 {
     return(CBExternal.hasRewardedVideo(location));
 }
Beispiel #10
0
 /// <summary>
 /// Cache a rewarded video at the given CBLocation.
 /// This method will first check if there is a locally cached rewarded video
 /// for the given CBLocation and, if found, will do nothing. If no locally cached data exists
 ///	the method will attempt to fetch data from the Chartboost API server.
 /// </summary>
 /// <param name="location">The location for the Chartboost impression type.</param>
 public static void cacheRewardedVideo(CBLocation location)
 {
     CBExternal.cacheRewardedVideo(location);
 }
Beispiel #11
0
 /// <summary>
 /// Present an "more applications" for the given CBLocation.
 /// This method will first check if there is a locally cached "more applications"
 ///	for the given CBLocation and, if found, will present using the locally cached data.
 ///	If no locally cached data exists the method will attempt to fetch data from the
 ///	Chartboost API server and present it.  If the Chartboost API server is unavailable
 ///	or there is no eligible "more applications" to present in the given CBLocation this method
 ///	is a no-op.
 /// </summary>
 /// <param name="location">The location for the Chartboost impression type.</param>
 public static void showMoreApps(CBLocation location)
 {
     CBExternal.showMoreApps(location);
 }
Beispiel #12
0
 /// <summary>
 /// Determine if a locally cached "more applications" exists for the given CBLocation.
 /// A return value of true here indicates that the corresponding
 /// showMoreApps:(CBLocation)location method will present without making
 ///	additional Chartboost API server requests to fetch data to present.
 /// </summary>
 /// <returns>true if the "more applications" is cached, false if not.</returns>
 /// <param name="location">The location for the Chartboost impression type.</param>
 public static bool hasMoreApps(CBLocation location)
 {
     return(CBExternal.hasMoreApps(location));
 }
Beispiel #13
0
 /// <summary>
 /// Cache an "more applications" at the given CBLocation.
 /// This method will first check if there is a locally cached "more applications"
 /// for the given CBLocation and, if found, will do nothing. If no locally cached data exists
 ///	the method will attempt to fetch data from the Chartboost API server.
 /// </summary>
 /// <param name="location">The location for the Chartboost impression type.</param>
 public static void cacheMoreApps(CBLocation location)
 {
     CBExternal.cacheMoreApps(location);
 }
Beispiel #14
0
 /// <summary>
 /// Present an interstitial for the given CBLocation.
 /// This method will first check if there is a locally cached interstitial
 ///	for the given CBLocation and, if found, will present using the locally cached data.
 ///	If no locally cached data exists the method will attempt to fetch data from the
 ///	Chartboost API server and present it.  If the Chartboost API server is unavailable
 ///	or there is no eligible interstitial to present in the given CBLocation this method
 ///	is a no-op.
 /// </summary>
 /// <param name="location">The location for the Chartboost impression type.</param>
 public static void showInterstitial(CBLocation location)
 {
     CBExternal.showInterstitial(location);
 }
 void willDisplayVideo(CBLocation location)
 {
 }
 void didCacheInterstitial(CBLocation location)
 {
 }
Beispiel #17
0
 /// <summary>
 /// Present a rewarded video for the given CBLocation.
 /// This method will first check if there is a locally cached rewarded video
 ///	for the given CBLocation and, if found, will present using the locally cached data.
 ///	If no locally cached data exists the method will attempt to fetch data from the
 ///	Chartboost API server and present it.  If the Chartboost API server is unavailable
 ///	or there is no eligible rewarded video to present in the given CBLocation this method
 ///	is a no-op.
 /// </summary>
 /// <param name="location">The location for the Chartboost impression type.</param>
 public static void showRewardedVideo(CBLocation location)
 {
     CBExternal.showRewardedVideo(location);
 }
	void didDisplayInterstitial(CBLocation location){
		AddLog("didDisplayInterstitial: " + location);
	}
Beispiel #19
0
 /// <summary>
 /// Cache an in play ad at the given CBLocation.
 /// This method will first check if there is a locally cached in play ad
 /// for the given CBLocation and, if found, will do nothing. If no locally cached data exists
 ///	the method will attempt to fetch data from the Chartboost API server.
 /// </summary>
 /// <param name="location">The location for the Chartboost impression type.</param>
 public static void cacheInPlay(CBLocation location)
 {
     CBExternal.cacheInPlay(location);
 }
	void didFailToRecordClick(CBLocation location, CBClickError error) {
		AddLog(string.Format("didFailToRecordClick: {0} at location: {1}", error, location));
	}
Beispiel #21
0
 /// <summary>
 /// Determine if a locally cached in play ad exists for the given CBLocation.
 /// A return value of true here indicates that the corresponding
 /// getInPlay:(CBLocation)location method will present without making
 ///	additional Chartboost API server requests to fetch data to present.
 /// </summary>
 /// <returns>true if the in play ad is cached, false if not.</returns>
 /// <param name="location">The location for the Chartboost impression type.</param>
 public static bool hasInPlay(CBLocation location)
 {
     return(CBExternal.hasInPlay(location));
 }
	void didCompleteRewardedVideo(CBLocation location, int reward) {
		AddLog(string.Format("didCompleteRewardedVideo: reward {0} at location {1}", reward, location));
	}
Beispiel #23
0
 /// <summary>
 /// Gets an in play ad for the given CBLocation.
 /// This method will first check if there is a locally cached in play ad
 ///	for the given CBLocation and, if found, will present using the locally cached data.
 ///	If no locally cached data exists the method will attempt to fetch data from the
 ///	Chartboost API server and present it.  If the Chartboost API server is unavailable
 ///	or there is no eligible in play ad to present in the given CBLocation this method
 ///	will return null.
 /// </summary>
 /// <returns>Returns an object of CBInPlay class, which contains a Texture2D of the appIcon and a String AppName. Look at CBInPlay.cs for more information.</returns>
 /// <param name="location">The location for the Chartboost impression type.</param>
 public static CBInPlay getInPlay(CBLocation location)
 {
     return(CBExternal.getInPlay(location));
 }
	void willDisplayVideo(CBLocation location) {
		AddLog("willDisplayVideo: " + location);
	}
Beispiel #25
0
 public static bool hasInPlay(CBLocation location)
 {
     Log("Unity : hasInPlay at location = " + location.ToString());
     return(false);
 }
 void didFailToLoadRewardedVideo(CBLocation location, CBImpressionError error)
 {
 }
Beispiel #27
0
 public static CBInPlay getInPlay(CBLocation location)
 {
     Log("Unity : getInPlay at location = " + location.ToString());
     return(null);
 }
 bool shouldDisplayInterstitial(CBLocation location)
 {
     return showInterstitial;
 }
Beispiel #29
0
 /// Checks for a cached a rewarded video.
 public static bool hasRewardedVideo(CBLocation location)
 {
     Log("Unity : hasRewardedVideo at location = " + location.ToString());
     return(false);
 }
 bool shouldDisplayRewardedVideo(CBLocation location)
 {
     return showRewardedVideo;
 }
Beispiel #31
0
 /// Loads a rewarded video.
 public static void showRewardedVideo(CBLocation location)
 {
     Log("Unity : showRewardedVideo at location = " + location.ToString());
 }
 void didCacheInPlay(CBLocation location)
 {
 }
Beispiel #33
0
 /// Checks for a cached an interstitial.
 public static bool hasInterstitial(CBLocation location)
 {
     Log("Unity : hasInterstitial at location = " + location.ToString());
     return(false);
 }
	void didFailToLoadInterstitial(CBLocation location, CBImpressionError error) {
		AddLog(string.Format("didFailToLoadInterstitial: {0} at location {1}", error, location));
	}
Beispiel #35
0
 /// Loads an interstitial.
 public static void showInterstitial(CBLocation location)
 {
     Log("Unity : showInterstitial at location = " + location.ToString());
 }
	bool shouldDisplayInterstitial(CBLocation location) {
		// return true if you want to allow the interstitial to be displayed
		AddLog("shouldDisplayInterstitial @" + location + " : " + showInterstitial);
		return showInterstitial;
	}
Beispiel #37
0
 /// Checks to see if the more apps screen is cached.
 public static bool hasMoreApps(CBLocation location)
 {
     Log("Unity : hasMoreApps at location = " + location.ToString());
     return(false);
 }
	void didCacheMoreApps(CBLocation location) {
		AddLog(string.Format("didCacheMoreApps at location: {0}", location));
	}
Beispiel #39
0
 /// Shows the more apps screen.
 public static void showMoreApps(CBLocation location)
 {
     Log("Unity : showMoreApps at location = " + location.ToString());
 }
	void didDisplayMoreApps(CBLocation location){
		AddLog("didDisplayMoreApps: " + location);
	}
Beispiel #41
0
 public static void cacheInPlay(CBLocation location)
 {
     Log("Unity : cacheInPlay at location = " + location.ToString());
 }
	void didFailToLoadRewardedVideo(CBLocation location, CBImpressionError error) {
		AddLog(string.Format("didFailToLoadRewardedVideo: {0} at location {1}", error, location));
	}
 void didDisplayRewardedVideo(CBLocation location)
 {
 }
	bool shouldDisplayRewardedVideo(CBLocation location) {
		AddLog("shouldDisplayRewardedVideo @" + location + " : " + showRewardedVideo);
		return showRewardedVideo;
	}
 void didFailToLoadInPlay(CBLocation location, CBImpressionError error)
 {
 }
	void didDisplayRewardedVideo(CBLocation location){
		AddLog("didDisplayRewardedVideo: " + location);
	}
 void didFailToLoadInterstitial(CBLocation location, CBImpressionError error)
 {
 }
	void didFailToLoadInPlay(CBLocation location, CBImpressionError error) {
		AddLog(string.Format("didFailToLoadInPlay: {0} at location: {1}", error, location));
	}
 void didFailToLoadMoreApps(CBLocation location, CBImpressionError error)
 {
 }
 public void onAdClosed(CBLocation location)
 {
     Chartboost.didCloseInterstitial -= onAdClosed;
     Application.LoadLevel ("MainScene");
 }
Beispiel #51
0
        //////////////////////////////////////////////////////
        /// Functions for showing ads
        //////////////////////////////////////////////////////

        /// <summary>
        /// Cache an interstitial at the given CBLocation.
        /// This method will first check if there is a locally cached interstitial
        /// for the given CBLocation and, if found, will do nothing. If no locally cached data exists
        ///	the method will attempt to fetch data from the Chartboost API server.
        /// </summary>
        /// <param name="location">The location for the Chartboost impression type.</param>
        public static void cacheInterstitial(CBLocation location)
        {
            CBExternal.cacheInterstitial(location);
        }