Hello
Unity Mediation Beta v.0.5.1-preview1 question.
Unity 2021.3.8f1
I couldn’t find an answer on the forum so I’d like to ask. If it is explained anywhere in the documentation please let me know where to find it. Thank you.
The problem (a bug or my wrong implementation):
In Unity Ads, in the Editor and on Android device I was able to pause the game while ‘test ad’ was being presented (Interstitial or Rewarded Ads). The game was correctly paused with these two lines of code:
//Pause game.
Time.timeScale = 0;
AudioListener.pause = true;
Closing the ad was correctly restarting the game where it left off before ‘test ad’ was started to show.
//Re-Start game.
Time.timeScale = 1;
AudioListener.pause = false;
In Unity Mediation Beta v.0.5.1-preview1 when I use the same two lines of code to pause the game it appears that it pauses the ‘test ad’ as well or just the animation at the bottom (thin line)? Both Interstitial and Rewarded Ads.
Unity Mediation ‘test ad’ without these two lines of code animates loading/presenting the test ad at the very bottom (thin blue line) correctly and finishes 100% (running from left to right).
With two lines of code added to ShowInterstitial() it does not animate. The game is paused correctly but the test ad seems to be paused as well?
Here’s my testing code snippet that prevents ‘test ad’ from running to the end (left to right animation). Could it be that it’s only visually affected but the ad works ok?
public async void ShowInterstitial()
{
//Pause game.
Time.timeScale = 0;
AudioListener.pause = true;
if (m_InterstitialAd?.AdState == AdState.Loaded)
{
try
{
var showOptions = new InterstitialAdShowOptions { AutoReload = true };
await m_InterstitialAd.ShowAsync(showOptions);
}
catch (ShowFailedException e)
{
}
}
}
I also tried to place it within ‘try - catch’ before and after:
await m_InterstitialAd.ShowAsync(showOptions);
…but it made no difference. I also tried to run pause/restart logic in the Update method but it also didn’t work for me.
Your help would be really appreciated.
Thank you