I am making a mobile game with unity. I need to make it so that all game activity is paused while the ad is running. My ad script is below:
public void ShowAd()
{
Advertisement.Initialize(GameId, true);
StartCoroutine(ShowAdWhenReady());
}
IEnumerator ShowAdWhenReady()
{
while (!Advertisement.IsReady())
yield return null;
Advertisement.Show();
}
}
↧