So after linking my project I create an empty gameobject and name it AdControl and I add rewarded script on it and then I place it to my ButtonVideoAds. The problem is that is doesn't show anything but when I try it with the simple code it shows the ad. PLEASE HELP. I'm really bad to find out the problem.
This is the RewarderAdd script:
using UnityEngine;
using UnityEngine.Advertisements;
public class RewardedAds : MonoBehaviour
{
public void ShowRewardedAd()
{
if (Advertisement.IsReady("rewardedVideoZone"))
{
var options = new ShowOptions { resultCallback = HandleShowResult };
Advertisement.Show("rewardedVideoZone", options);
}
}
private void HandleShowResult(ShowResult result)
{
switch (result)
{
case ShowResult.Finished:
Debug.Log("The ad was successfully shown.");
//
// YOUR CODE TO REWARD THE GAMER
// Give coins etc.
break;
case ShowResult.Skipped:
Debug.Log("The ad was skipped before reaching the end.");
break;
case ShowResult.Failed:
Debug.LogError("The ad failed to be shown.");
break;
}
}
}
↧