public void showRewardedVideo() { if (Application.internetReachability != NetworkReachability.NotReachable) { if (Advertisement.IsReady("rewardedVideo")) { const string RewardedZoneId = "rewardedVideo"; var options = new ShowOptions { resultCallback = onUnityRewardedComplete }; Advertisement.Show(RewardedZoneId, options); AudioManager.GetInstance().Mute(true); } else if (Chartboost.hasRewardedVideo(CBLocation.locationFromName("Video Interstitial"))) { Chartboost.didCompleteRewardedVideo += onRewardedVideoComplete; Chartboost.didCloseRewardedVideo += onRewardedVideoClose; Chartboost.showRewardedVideo(CBLocation.locationFromName("Video Interstitial")); AudioManager.GetInstance().Mute(true); } else { Debug.Log("Something went wront"); } } }
public void showRewardAd() { if (Chartboost.hasRewardedVideo(CBLocation.Default)) { Chartboost.showRewardedVideo(CBLocation.locationFromName("Default")); } else { Chartboost.cacheRewardedVideo(CBLocation.MainMenu); UseReviveText.text = "Failed, Try Again"; } }
public void showVideoAds() { if (Application.internetReachability != NetworkReachability.NotReachable) { if (Advertisement.IsReady()) { Advertisement.Show("video"); } else if (Chartboost.hasInterstitial(CBLocation.locationFromName("Video Interstitial"))) { Chartboost.showInterstitial(CBLocation.locationFromName("Video Interstitial")); } } }
public void ShowInterstitialIngame() { if (Application.internetReachability == NetworkReachability.NotReachable) { return; } #if UNITY_IPHONE if (_isInitialized) { if (Chartboost.hasInterstitial(CBLocation.locationFromName("Static Interstitial"))) { Chartboost.showInterstitial(CBLocation.locationFromName("Static Interstitial")); } } #endif }
private void initPlugins() { Chartboost.CreateWithAppId("CHARTBOOST_APP_ID_IOS", "CHARTBOOST_APP_SIGNATURE_IOS"); Chartboost.cacheMoreApps(CBLocation.Default); Chartboost.cacheRewardedVideo(CBLocation.locationFromName("Video Interstitial")); Chartboost.cacheInterstitial(CBLocation.locationFromName("Video Interstitial")); Chartboost.cacheInterstitial(CBLocation.locationFromName("Static Interstitial")); Chartboost.cacheInterstitial(CBLocation.Default); if (Advertisement.isSupported) // If runtime platform is supported... { Advertisement.Initialize(GameConfig.UNITY_ADS_ID, GameConfig.UNITY_ADS_TEST_MODE); // ...initialize. } _isInitialized = true; }
// Update is called once per frame void Update() { ItemBalance = StoreInventory.GetItemBalance("no_ads"); if (ItemBalance > 0) { showAd = false; } else { showAd = true; } if (showAd == true && hasDisplayed == false) { Chartboost.showInterstitial(CBLocation.locationFromName("Lose")); hasDisplayed = true; } }
public void ShowStaticInterstitialIngameFirst() { if (Application.internetReachability == NetworkReachability.NotReachable) { return; } #if UNITY_IPHONE if (_isInitialized) { if (_chartboostInterstitialIsCached || Chartboost.hasInterstitial(CBLocation.locationFromName("Static Interstitial"))) { Chartboost.didCloseInterstitial += onChartboostStartInterstitialClose; Chartboost.showInterstitial(CBLocation.locationFromName("Static Interstitial")); Chartboost.cacheInterstitial(CBLocation.locationFromName("Static Interstitial")); } } #endif }
public void ShowMoreGames() { if (Application.internetReachability == NetworkReachability.NotReachable) { #if UNITY_IPHONE if (Chartboost.hasMoreApps(CBLocation.Default)) { ShowInterstitialCharboostMoreGames(); } else if (Advertisement.IsReady()) { Advertisement.Show("video"); } else if (Chartboost.hasInterstitial(CBLocation.locationFromName("Video Interstitial"))) { Chartboost.showInterstitial(CBLocation.locationFromName("Video Interstitial")); } #endif #if UNITY_WINRT Application.OpenURL(GameConfig.MOREGAMES_WP8); #endif } }
IEnumerator WaitForOrientationAndLoadChartboost() { var menuState = BibaSceneStack.Peek(); if (menuState is SceneMenuState && BibaUtility.CheckForInternetConnection()) { while (Screen.orientation != ((SceneMenuState)menuState).Orientation) { yield return(null); } Chartboost.setShouldPauseClickForConfirmation(true); Chartboost.showInterstitial(BibaDeviceSession.TagEnabled ? CBLocation.locationFromName(BibaAnalyticConstants.HOUSE_AD) : CBLocation.Default); Chartboost.didDisplayInterstitial += InterstitialLoaded; Chartboost.didFailToLoadInterstitial += FailToLoadInterstitial; var timeLapsed = 0f; while (timeLapsed < CHART_BOOST_TIME_OUT && !_loadedChartboost) { timeLapsed += Time.deltaTime; yield return(null); } Chartboost.didDisplayInterstitial -= InterstitialLoaded; Chartboost.didFailToLoadInterstitial -= FailToLoadInterstitial; if (!_loadedChartboost) { SetMenuStateTriggerSignal.Dispatch(MenuStateTrigger.Next); } } else { SetMenuStateTriggerSignal.Dispatch(MenuStateTrigger.Next); } Release(); }
public CBLocation ToChartboostLocation() { return(CBLocation.locationFromName(this.name)); }
private CBLocation ToCBLocation(AdPlacement placement) { return(placement == null || placement == AdPlacement.Default ? CBLocation.Default : CBLocation.locationFromName(placement.Name)); }
/// <summary> /// Creates an instance of this class. /// </summary> /// <param name="placementId">The placement id for this ad.</param> public ChartboostRewardedVideoAd(string placementId) { location = CBLocation.locationFromName(placementId); }
private void SetChartboostData() { cbLocation = CBLocation.locationFromName(context.location); CBSettings.setAppId(context.key, context.signature); }
/// <summary> /// Creates an instance of this class. /// </summary> /// <param name="placementId">The placement id for this ad.</param> public ChartboostInterstitialAd(string placementId) { location = CBLocation.locationFromName(placementId); }