Shayke
1
Hi, i released my game and i noticed that when i click on the button fast enough before the ad appears the player gets the reward more than once!
public void ShowAd30secForCoins()
{
if (Advertisement.IsReady())
{
Advertisement.Show("rewardedVideo", new ShowOptions() { resultCallback = HandleResult30ForCoin });
}
}
public void HandleResult30(ShowResult result)
{
switch (result)
{
case ShowResult.Finished:
Spins += 3;
// Debug.Log("Win30");
break;
case ShowResult.Skipped:
// Debug.Log("Skip");
break;
case ShowResult.Failed:
// Debug.Log("Fail");
break;
}
}
Why don’t you do something like?
bool rewarded;
public void ShowAd30secForCoins()
{
if (Advertisement.IsReady())
{
rewarded = false;
Advertisement.Show("rewardedVideo", new ShowOptions() { resultCallback = HandleResult30ForCoin });
}
}
public void HandleResult30(ShowResult result)
{
switch (result)
{
case ShowResult.Finished:
if(!rewarded)
Spins += 3;
rewarded = true;
// Debug.Log("Win30");
break;
case ShowResult.Skipped:
// Debug.Log("Skip");
break;
case ShowResult.Failed:
// Debug.Log("Fail");
break;
}
}
Might not be the prettiest fix, but should work
Shayke
3
Nope, That’s not working.
It’s like doing the same.
Maybe i can make an Invoke function that after a second it can be pressed again.
Edit: Well, the invoke with your solution work.
A bit lame but that’s enough lol.
Thanks