public void ShowRewardedAd(AdLocation location) { #if UNITY_ADS if (IsRewardedAdReady(location)) { var showOptions = new ShowOptions { resultCallback = (result) => { RewardedAdCallback(result, location); } }; Advertisement.Show( location == AdLocation.Default ? DEFAULT_REWARDED_ZONE_ID : location.ToUnityAdsZoneId(), showOptions ); } else { Debug.Log("Could not show UnityAds rewarded ad: ad is not loaded."); } #else Debug.LogError(NO_SDK_MESSAGE); #endif }
public bool IsRewardedAdReady(AdLocation location) { #if UNITY_ADS return(Advertisement.IsReady( location == AdLocation.Default ? DEFAULT_REWARDED_ZONE_ID : location.ToUnityAdsZoneId() )); #else return(false); #endif }
public bool IsInterstitialAdReady(AdLocation location) { #if UNITY_ADS return(Advertisement.IsReady( location == AdLocation.Default ? DEFAULT_VIDEO_ZONE_ID : location.ToUnityAdsZoneId() )); #else return(false); #endif }