- Home /
Question by
manishsaini74 · Jul 24, 2018 at 11:07 AM ·
adsscene-loadingscene loadunityads
showing ad only one time.
Hi I have added an ad for rewarded video when game is over if user completed it reload the scene.But every time it shows ad after game over even user watched ad already i want user can only watch ad once. My code is :
bool canshowad = true;
public void ShowAd(string zone = "rewardedVideoZone ")
{
if (canshowad)
{
ShowOptions options = new ShowOptions();
options.resultCallback = AdCallbackhanler;
if (Advertisement.IsReady(zone))
{
Advertisement.Show(zone, options);
}
}
else
Debug.Log("No ads");
}
void AdCallbackhanler(ShowResult result)
{
switch (result)
{
case ShowResult.Finished:
SceneManager.LoadScene(SceneManager.GetActiveScene().name);
break;
case ShowResult.Skipped:
break;
case ShowResult.Failed:
break;
}
}
When i reload the scene canshowad become true and my condition override.Please help in this.Thanks in advance.
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220612171417im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Scene freezes after loaded 1 Answer
How to transition from Load to scene ? 1 Answer
Trouble implementing UnityAds alongside SFML 0 Answers
My ad doesnt play on startup... 1 Answer