예제 #1
0
 /// <summary>
 /// Attempts to show an ad from Chartboost for the given CBLocation.
 /// </summary>
 public static void ChartboostShowForLocation(string location)
 {
     #if UNITY_ANDROID
     HZInterstitialAdAndroid.chartboostShowForLocation(location);
     #elif UNITY_IPHONE && !UNITY_EDITOR
     HZInterstitialAdIOS.chartboostShowForLocation(location);
     #else
     #endif
 }
예제 #2
0
 /// <summary>
 /// Returns whether an ad is available at the given CBLocation.
 /// </summary>
 public static bool ChartboostIsAvailableForLocation(string location)
 {
     #if UNITY_ANDROID
     return(HZInterstitialAdAndroid.chartboostIsAvailableForLocation(location));
     #elif UNITY_IPHONE && !UNITY_EDITOR
     return(HZInterstitialAdIOS.chartboostIsAvailableForLocation(location));
     #else
     return(false);
     #endif
 }
예제 #3
0
 /// <summary>
 /// Returns whether or not an ad is available.
 /// </summary>
 /// <returns><c>true</c>, if an ad is available, <c>false</c> otherwise.</returns>
 public static bool IsAvailable()
 {
     #if UNITY_ANDROID
     return(HZInterstitialAdAndroid.IsAvailable());
     #elif UNITY_IPHONE && !UNITY_EDITOR
     return(HZInterstitialAdIOS.IsAvailable());
     #else
     return(false);
     #endif
 }
예제 #4
0
        /// <summary>
        /// Fetches an ad
        /// </summary>
        public static void Fetch()
        {
            #if UNITY_ANDROID
            HZInterstitialAdAndroid.Fetch();
            #endif

            #if UNITY_IPHONE && !UNITY_EDITOR
            HZInterstitialAdIOS.Fetch();
            #endif
        }
예제 #5
0
 /// <summary>
 /// Fetches an ad from Chartboost for the given CBLocation.
 /// </summary>
 public static void ChartboostFetchForLocation(string location)
 {
     #if !UNITY_EDITOR && (UNITY_ANDROID || UNITY_IPHONE)
         #if UNITY_ANDROID
     HZInterstitialAdAndroid.chartboostFetchForLocation(location);
         #elif UNITY_IPHONE
     HZInterstitialAdIOS.chartboostFetchForLocation(location);
         #endif
     #else
     #endif
 }
예제 #6
0
        /// <summary>
        /// Fetches an ad for the given ad tag.
        /// </summary>
        /// <param name="tag">The ad tag to fetch an ad for.</param>
        public static void Fetch(string tag)
        {
            tag = HeyzapAds.TagForString(tag);

            #if UNITY_ANDROID
            HZInterstitialAdAndroid.Fetch(tag);
            #endif

            #if UNITY_IPHONE && !UNITY_EDITOR
            HZInterstitialAdIOS.Fetch(tag);
            #endif
        }
예제 #7
0
        /// <summary>
        /// Returns whether or not an ad is available for the given ad tag.
        /// </summary>
        /// <returns><c>true</c>, if an ad is available, <c>false</c> otherwise.</returns>
        public static bool IsAvailable(string tag)
        {
            tag = HeyzapAds.TagForString(tag);

            #if UNITY_ANDROID
            return(HZInterstitialAdAndroid.IsAvailable(tag));
            #elif UNITY_IPHONE && !UNITY_EDITOR
            return(HZInterstitialAdIOS.IsAvailable(tag));
            #else
            return(false);
            #endif
        }
예제 #8
0
        /// <summary>
        /// Fetches an ad for the given ad tag.
        /// </summary>
        /// <param name="tag">The ad tag to fetch an ad for.</param>
        public static void Fetch(string tag)
        {
            tag = HeyzapAds.TagForString(tag);

            #if !UNITY_EDITOR && (UNITY_ANDROID || UNITY_IPHONE)
                #if UNITY_ANDROID
            HZInterstitialAdAndroid.Fetch(tag);
                #elif UNITY_IPHONE
            HZInterstitialAdIOS.Fetch(tag);
                #endif
            #else
            UnityEngine.Debug.LogWarning("Call received to fetch an HZInterstitialAd, but the SDK does not function in the editor. You must use a device/emulator to fetch/show ads.");
            _instance.StartCoroutine(InvokeCallbackNextFrame(HeyzapAds.NetworkCallback.FETCH_FAILED, tag));
            #endif
        }
예제 #9
0
        /// <summary>
        /// Shows an ad with the given options.
        /// </summary>
        /// <param name="showOptions"> The options to show the ad with, or the default options if <c>null</c></param>
        public static void ShowWithOptions(HZShowOptions showOptions)
        {
            if (showOptions == null)
            {
                showOptions = new HZShowOptions();
            }

            #if UNITY_ANDROID
            HZInterstitialAdAndroid.ShowWithOptions(showOptions);
            #endif

            #if UNITY_IPHONE && !UNITY_EDITOR
            HZInterstitialAdIOS.ShowWithOptions(showOptions);
            #endif
        }
예제 #10
0
        /// <summary>
        /// Shows an ad with the given options.
        /// </summary>
        /// <param name="showOptions"> The options to show the ad with, or the default options if <c>null</c></param>
        public static void ShowWithOptions(HZShowOptions showOptions)
        {
            if (showOptions == null)
            {
                showOptions = new HZShowOptions();
            }

            #if !UNITY_EDITOR && (UNITY_ANDROID || UNITY_IPHONE)
                #if UNITY_ANDROID
            HZInterstitialAdAndroid.ShowWithOptions(showOptions);
                #elif UNITY_IPHONE
            HZInterstitialAdIOS.ShowWithOptions(showOptions);
                #endif
            #else
            UnityEngine.Debug.LogWarning("Call received to show an HZInterstitalAd, but the SDK does not function in the editor. You must use a device/emulator to fetch/show ads.");
            _instance.StartCoroutine(InvokeCallbackNextFrame(HeyzapAds.NetworkCallback.SHOW_FAILED, showOptions.Tag));
            #endif
        }