I'm trying to get ads working on Android but I keep getting this error
"The imported type `UnityEngine.Advertisements.ShowResult' is defined multiple times"
Im not sure how to fix it. Here is my script
using UnityEngine;
using UnityEngine.Advertisements;
public class ADManager : MonoBehaviour {
public void ShowAd()
{
if (Advertisement.IsReady("rewardedVideoZone"))
{
var options = new ShowOptions { resultCallback = HandleShowResult };
Advertisement.Show("rewardedVideoZone", options);
}
}
public void HandleShowResult(ShowResult result)
{
switch (result)
{
case ShowResult.Finished:
Debug.Log("The ad was successfully shown.");
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;
}
}
}
If anyone has any answers that would be great help.
Thank you in advance.
↧