Ejemplo n.º 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)
 {
 }
Ejemplo n.º 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));
 }
Ejemplo n.º 5
0
	void didCacheInPlay(CBLocation location) {
		AddLog("didCacheInPlay called: "+location);
	}
Ejemplo n.º 6
0
	void didCacheRewardedVideo(CBLocation location) {
		AddLog("didCacheRewardedVideo: " + location);
	}
Ejemplo n.º 7
0
	bool shouldDisplayMoreApps(CBLocation location) {
		AddLog(string.Format("shouldDisplayMoreApps at location: {0}: {1}", location, showMoreApps));
		return showMoreApps;
	}
Ejemplo n.º 8
0
	void didCacheInterstitial(CBLocation location) {
		AddLog("didCacheInterstitial: " + location);
	}
Ejemplo n.º 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));
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 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));
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 15
0
 void willDisplayVideo(CBLocation location)
 {
 }
Ejemplo n.º 16
0
 void didCacheInterstitial(CBLocation location)
 {
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 18
0
	void didDisplayInterstitial(CBLocation location){
		AddLog("didDisplayInterstitial: " + location);
	}
Ejemplo n.º 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);
 }
Ejemplo n.º 20
0
	void didFailToRecordClick(CBLocation location, CBClickError error) {
		AddLog(string.Format("didFailToRecordClick: {0} at location: {1}", error, location));
	}
Ejemplo n.º 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));
 }
Ejemplo n.º 22
0
	void didCompleteRewardedVideo(CBLocation location, int reward) {
		AddLog(string.Format("didCompleteRewardedVideo: reward {0} at location {1}", reward, location));
	}
Ejemplo n.º 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));
 }
Ejemplo n.º 24
0
	void willDisplayVideo(CBLocation location) {
		AddLog("willDisplayVideo: " + location);
	}
Ejemplo n.º 25
0
 public static bool hasInPlay(CBLocation location)
 {
     Log("Unity : hasInPlay at location = " + location.ToString());
     return(false);
 }
Ejemplo n.º 26
0
 void didFailToLoadRewardedVideo(CBLocation location, CBImpressionError error)
 {
 }
Ejemplo n.º 27
0
 public static CBInPlay getInPlay(CBLocation location)
 {
     Log("Unity : getInPlay at location = " + location.ToString());
     return(null);
 }
Ejemplo n.º 28
0
 bool shouldDisplayInterstitial(CBLocation location)
 {
     return showInterstitial;
 }
Ejemplo n.º 29
0
 /// Checks for a cached a rewarded video.
 public static bool hasRewardedVideo(CBLocation location)
 {
     Log("Unity : hasRewardedVideo at location = " + location.ToString());
     return(false);
 }
Ejemplo n.º 30
0
 bool shouldDisplayRewardedVideo(CBLocation location)
 {
     return showRewardedVideo;
 }
Ejemplo n.º 31
0
 /// Loads a rewarded video.
 public static void showRewardedVideo(CBLocation location)
 {
     Log("Unity : showRewardedVideo at location = " + location.ToString());
 }
Ejemplo n.º 32
0
 void didCacheInPlay(CBLocation location)
 {
 }
Ejemplo n.º 33
0
 /// Checks for a cached an interstitial.
 public static bool hasInterstitial(CBLocation location)
 {
     Log("Unity : hasInterstitial at location = " + location.ToString());
     return(false);
 }
Ejemplo n.º 34
0
	void didFailToLoadInterstitial(CBLocation location, CBImpressionError error) {
		AddLog(string.Format("didFailToLoadInterstitial: {0} at location {1}", error, location));
	}
Ejemplo n.º 35
0
 /// Loads an interstitial.
 public static void showInterstitial(CBLocation location)
 {
     Log("Unity : showInterstitial at location = " + location.ToString());
 }
Ejemplo n.º 36
0
	bool shouldDisplayInterstitial(CBLocation location) {
		// return true if you want to allow the interstitial to be displayed
		AddLog("shouldDisplayInterstitial @" + location + " : " + showInterstitial);
		return showInterstitial;
	}
Ejemplo n.º 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);
 }
Ejemplo n.º 38
0
	void didCacheMoreApps(CBLocation location) {
		AddLog(string.Format("didCacheMoreApps at location: {0}", location));
	}
Ejemplo n.º 39
0
 /// Shows the more apps screen.
 public static void showMoreApps(CBLocation location)
 {
     Log("Unity : showMoreApps at location = " + location.ToString());
 }
Ejemplo n.º 40
0
	void didDisplayMoreApps(CBLocation location){
		AddLog("didDisplayMoreApps: " + location);
	}
Ejemplo n.º 41
0
 public static void cacheInPlay(CBLocation location)
 {
     Log("Unity : cacheInPlay at location = " + location.ToString());
 }
Ejemplo n.º 42
0
	void didFailToLoadRewardedVideo(CBLocation location, CBImpressionError error) {
		AddLog(string.Format("didFailToLoadRewardedVideo: {0} at location {1}", error, location));
	}
Ejemplo n.º 43
0
 void didDisplayRewardedVideo(CBLocation location)
 {
 }
Ejemplo n.º 44
0
	bool shouldDisplayRewardedVideo(CBLocation location) {
		AddLog("shouldDisplayRewardedVideo @" + location + " : " + showRewardedVideo);
		return showRewardedVideo;
	}
Ejemplo n.º 45
0
 void didFailToLoadInPlay(CBLocation location, CBImpressionError error)
 {
 }
Ejemplo n.º 46
0
	void didDisplayRewardedVideo(CBLocation location){
		AddLog("didDisplayRewardedVideo: " + location);
	}
Ejemplo n.º 47
0
 void didFailToLoadInterstitial(CBLocation location, CBImpressionError error)
 {
 }
Ejemplo n.º 48
0
	void didFailToLoadInPlay(CBLocation location, CBImpressionError error) {
		AddLog(string.Format("didFailToLoadInPlay: {0} at location: {1}", error, location));
	}
Ejemplo n.º 49
0
 void didFailToLoadMoreApps(CBLocation location, CBImpressionError error)
 {
 }
Ejemplo n.º 50
0
 public void onAdClosed(CBLocation location)
 {
     Chartboost.didCloseInterstitial -= onAdClosed;
     Application.LoadLevel ("MainScene");
 }
Ejemplo n.º 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);
        }