Hi All,
I have created admob ads like below. but when the ads showing and close the ads, game start playing even I set the Time.timeScale = 0; . would you please check?
private void OnCollisionEnter2D(Collision2D collision)
{
if (collision.gameObject.tag=="DeadZone")
{
Time.timeScale = 0;
ScoreText.SetActive(false);
menu.SetActive(true);
RequestInterstitial();
}
}
private void RequestInterstitial()
{
string adUnitId = "ca-app-pub-4526259028819910/6688994189";
interstitial = new InterstitialAd(adUnitId);
interstitial.OnAdClosed += İnterstitial_OnAdClosed;
request = new AdRequest.Builder().Build();
interstitial.LoadAd(request);
if (interstitial.IsLoaded())
{
interstitial.Show();
}
}
private void İnterstitial_OnAdClosed(object sender, System.EventArgs e)
{
Time.timeScale = 0;
Debug.Log("Reklam Kapandı");
}
↧