Esempio 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)
 {
 }
Esempio 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));
 }
	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);
	}
Esempio 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));
 }
Esempio 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);
 }
Esempio 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);
 }
Esempio 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));
 }
Esempio 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);
 }
Esempio 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);
 }
 void willDisplayVideo(CBLocation location)
 {
 }
 void didCacheInterstitial(CBLocation location)
 {
 }
Esempio 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);
 }
Esempio n. 18
0
	void didDisplayInterstitial(CBLocation location){
		AddLog("didDisplayInterstitial: " + location);
	}
Esempio 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);
 }
Esempio n. 20
0
	void didFailToRecordClick(CBLocation location, CBClickError error) {
		AddLog(string.Format("didFailToRecordClick: {0} at location: {1}", error, location));
	}
Esempio 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));
 }
Esempio n. 22
0
	void didCompleteRewardedVideo(CBLocation location, int reward) {
		AddLog(string.Format("didCompleteRewardedVideo: reward {0} at location {1}", reward, location));
	}
Esempio 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));
 }
Esempio n. 24
0
	void willDisplayVideo(CBLocation location) {
		AddLog("willDisplayVideo: " + location);
	}
Esempio n. 25
0
 public static bool hasInPlay(CBLocation location)
 {
     Log("Unity : hasInPlay at location = " + location.ToString());
     return(false);
 }
 void didFailToLoadRewardedVideo(CBLocation location, CBImpressionError error)
 {
 }
Esempio n. 27
0
 public static CBInPlay getInPlay(CBLocation location)
 {
     Log("Unity : getInPlay at location = " + location.ToString());
     return(null);
 }
 bool shouldDisplayInterstitial(CBLocation location)
 {
     return showInterstitial;
 }
Esempio 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);
 }
 bool shouldDisplayRewardedVideo(CBLocation location)
 {
     return showRewardedVideo;
 }
Esempio n. 31
0
 /// Loads a rewarded video.
 public static void showRewardedVideo(CBLocation location)
 {
     Log("Unity : showRewardedVideo at location = " + location.ToString());
 }
 void didCacheInPlay(CBLocation location)
 {
 }
Esempio n. 33
0
 /// Checks for a cached an interstitial.
 public static bool hasInterstitial(CBLocation location)
 {
     Log("Unity : hasInterstitial at location = " + location.ToString());
     return(false);
 }
Esempio n. 34
0
	void didFailToLoadInterstitial(CBLocation location, CBImpressionError error) {
		AddLog(string.Format("didFailToLoadInterstitial: {0} at location {1}", error, location));
	}
Esempio n. 35
0
 /// Loads an interstitial.
 public static void showInterstitial(CBLocation location)
 {
     Log("Unity : showInterstitial at location = " + location.ToString());
 }
Esempio 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;
	}
Esempio 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);
 }
Esempio n. 38
0
	void didCacheMoreApps(CBLocation location) {
		AddLog(string.Format("didCacheMoreApps at location: {0}", location));
	}
Esempio n. 39
0
 /// Shows the more apps screen.
 public static void showMoreApps(CBLocation location)
 {
     Log("Unity : showMoreApps at location = " + location.ToString());
 }
Esempio n. 40
0
	void didDisplayMoreApps(CBLocation location){
		AddLog("didDisplayMoreApps: " + location);
	}
Esempio n. 41
0
 public static void cacheInPlay(CBLocation location)
 {
     Log("Unity : cacheInPlay at location = " + location.ToString());
 }
Esempio n. 42
0
	void didFailToLoadRewardedVideo(CBLocation location, CBImpressionError error) {
		AddLog(string.Format("didFailToLoadRewardedVideo: {0} at location {1}", error, location));
	}
 void didDisplayRewardedVideo(CBLocation location)
 {
 }
Esempio n. 44
0
	bool shouldDisplayRewardedVideo(CBLocation location) {
		AddLog("shouldDisplayRewardedVideo @" + location + " : " + showRewardedVideo);
		return showRewardedVideo;
	}
 void didFailToLoadInPlay(CBLocation location, CBImpressionError error)
 {
 }
Esempio n. 46
0
	void didDisplayRewardedVideo(CBLocation location){
		AddLog("didDisplayRewardedVideo: " + location);
	}
 void didFailToLoadInterstitial(CBLocation location, CBImpressionError error)
 {
 }
Esempio n. 48
0
	void didFailToLoadInPlay(CBLocation location, CBImpressionError error) {
		AddLog(string.Format("didFailToLoadInPlay: {0} at location: {1}", error, location));
	}
 void didFailToLoadMoreApps(CBLocation location, CBImpressionError error)
 {
 }
Esempio n. 50
0
 public void onAdClosed(CBLocation location)
 {
     Chartboost.didCloseInterstitial -= onAdClosed;
     Application.LoadLevel ("MainScene");
 }
Esempio 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);
        }