Quantcast
Viewing all articles
Browse latest Browse all 1416

Unity Ads: Rewarded video is not ready.

Hello, i have a problem with rewarded video ads. I dont see nothing wrong... My code is: public void WatchVideoForCoinButtonClick() { // avoid multiple click if (clicking == true) return; clicking = true; StartCoroutine(ResetButtonClick()); if (Advertisement.IsReady("rewardedVideo")) { var options = new ShowOptions { resultCallback = HandleShowResult }; Advertisement.Show("rewardedVideo", options); } else { Debug.Log("Unity Ads: Rewarded video is not ready."); } } private void HandleShowResult(ShowResult result) { switch (result) { case ShowResult.Finished: Debug.Log("Unity Ads: The ad was successfully shown."); // plus coin GameData.instance.SavePlayerCoin(GameData.instance.GetPlayerCoin() + Configure.instance.watchVideoCoin); // play add coin sound AudioManager.instance.CoinAddAudio(); // update text label UpdateCoinAmountLabel(); break; case ShowResult.Skipped: Debug.Log("Unity Ads: The ad was skipped before reaching the end."); break; case ShowResult.Failed: Debug.LogError("Unity Ads: The ad failed to be shown."); break; } }

Viewing all articles
Browse latest Browse all 1416

Trending Articles



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