
[ad_1]
When the participant object collides with one other object, it disappears and the “sport over” menu is opened and the rating is displayed. Just then, the “interstitials” commercial ought to seem. The script beneath works when the “Game over” object is energetic. When I get each unity and construct on my telephone, it really works fantastic with google “check advert id”.
But I revealed the sport on google play retailer to see what occurs.
I added the sport in my Google AdMob account and made all the mandatory settings. In Google AdMob, the advert standing is “Ready”, which implies the evaluation has been accomplished and permitted.
But after I set up and take a look at the sport on totally different telephones, the advertisements don’t seem.
I’m looking for out if that is my fault.
I put the appliance advert id and advert unit ids within the mandatory locations. Already check advertisements are working with none issues.
utilizing UnityEngine;
utilizing System.Collections;
utilizing GoogleMobileAds.Api;
utilizing UnityEngine.UI;
public class AdScript : MonoBehaviour
{
public GameObject scriptsForPause;
public Button gameSceneButton;
personal InterstitialAd interstitial;
void Start()
{
gameSceneButton.interactable = false;
scriptsForPause.gameObject.SetActive(false);
MobileAds.Initialize(adStatus=> { });
if (interstitial != null)
interstitial.Destroy();
interstitial = new InterstitialAd("My interstitials advert id in Google Admob");
AdRequest wantAds = new AdRequest.Builder().Build();
interstitial.LoadAd(wantAds);
StartCoroutine(ShowAdverts());
}
IEnumerator ShowAdverts()
{
whereas (!interstitial.IsLoaded())
yield return null;
interstitial.Show();
}
void OnDestroy()
{
if (interstitial != null)
interstitial.Destroy();
}
}
[ad_2]