I want to embed banners in Unity using the ADS feature. But I get the error message: Adversiment does not contain a definition for IsReady. Here is the whole code:
using System.Collections;
using UnityEngine;
using UnityEngine.Advertisements;
public class BannerAd : MonoBehaviour {
public string gameId = "4824753";
public string placementId = "ShopBanner";
public bool testMode = true;
void Start () {
// Initialize the SDK if you haven't already done so:
Advertisement.Initialize (gameId, testMode);
StartCoroutine (ShowBannerWhenReady ());
}
IEnumerator ShowBannerWhenReady () {
while (!Advertisement.IsReady (placementId)) {
yield return new WaitForSeconds (0.5f);
}
Advertisement.Banner.Show (placementId);
}
}
I hope you will help me ! Thanks
↧