Quantcast
Channel: Questions in topic: "ads"
Viewing all articles
Browse latest Browse all 1416

Loading Bar Until Ad Show Up

$
0
0
Hi guys! I want to show a progress bar until Reward Based Video is loading and then showing but LoadRewardBasedAd i a void type so it does not return. How can i do the operation? Thanks for your help. private void LoadRewardBasedAd() { #if UNITY_EDITOR string adUnitId = "unused"; #elif UNITY_ANDROID string adUnitId = "ca-app-pub-3940256099942544/5224354917"; #elif UNITY_IPHONE string adUnitId = "ca-app-pub-3940256099942544/5224354917"; #else string adUnitId = "unecpected platfrom";s #endif rewardBasedVideoAd.LoadAd(new AdRequest.Builder().Build(), adUnitId); } private void ShowRewardBasedAd() { if(rewardBasedVideoAd.IsLoaded()) { rewardBasedVideoAd.Show(); } } IEnumerator LoadAsynchoronously() { AsyncOperation operation = LoadRewardBasedAd(); while(!operation.isDone) { Debug.Log(operation.progress); yield return null; } }

Viewing all articles
Browse latest Browse all 1416

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>