Hello guys im currently working on a game but my rewarded ads script works perfectly its just it wont give me the money after the ads finished please help here is my script and if anyone has a script for the shop please can you share it or help me because im so confused about it
using UnityEngine;
using UnityEngine.Advertisements;
public class Ads : MonoBehaviour
{
public string moneyPlayerPrefs = “Money”;
public int moneyLeft = 0;
public void ShowRewardedAd()
{
if (Advertisement.IsReady(“rewardedVideo”))
{
var options = new ShowOptions { resultCallback = HandleShowResult };
Advertisement.Show(“rewardedVideo”, options);
}
}
private void HandleShowResult(ShowResult result)
{
switch (result)
{
case ShowResult.Finished:
Debug.Log(“The ad was successfully shown.”);
moneyLeft = PlayerPrefs.GetInt(moneyPlayerPrefs, moneyLeft);
moneyLeft = moneyLeft + 100;
// 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;
}
}
}