In my android game I have an admob interstitial ad that appears when the player dies. However during gameplay on a mobile device there are random but extreme delays when playing.
The ad is requested and called in the start method:
public void Start(){
// Initialize an InterstitialAd.
interstitial = new InterstitialAd("ca-app-pub-3940256099942544/1033173712");
// Create an empty ad request.
AdRequest request = new AdRequest.Builder().Build();
// Load the interstitial with the request.
interstitial.LoadAd(request);
}
Then the ad is shown when the player loses at the end of the game.
if(playerB.isDead == true)
{
if (interstitial.IsLoaded()) {
interstitial.Show();
}
}
The game is restarted by reloading the level using `Application.LoadLevel()`
I think the issue is caused by requesting the ad when the game starts. Is there any solution to this or more efficient way to call the ad?
↧