I did this script but it isn’t doing anything
#if UNITY_IOS
private string gameId = "4434084";
#elif UNITY_ANDROID
private string gameId = "4434085";
#endif
bool testMode = true;
string myPlacementId = "ads";
public void ShowRewardedVideo()
{
Advertisement.Show(myPlacementId);
}
// Implement IUnityAdsListener interface methods:
public void OnUnityAdsReady(string placementId)
{
// If the ready Placement is rewarded, activate the button:
if (placementId == myPlacementId)
{
ButtonAds.interactable = true;
}
}
public void OnUnityAdsDidFinish(string placementId, ShowResult showResult)
{
// Define conditional logic for each ad completion status:
if (showResult == ShowResult.Finished)
{
TotalClicks += 1000;
}
else if (showResult == ShowResult.Skipped)
{
Debug.Log("player skipped");
}
else if (showResult == ShowResult.Failed)
{
Debug.LogWarning("The ad did not finish due to an error");
}
}
public void OnUnityAdsDidError(string message)
{
// Log the error.
}
public void OnUnityAdsDidStart(string placementId)
{
// Optional actions to take when the end-users trigger an ad.
}