using System.Collections;
using UnityEngine;
using UnityEngine.Advertisements;
public class AdController : MonoBehaviour
{
public string gameId = "1234567";
public string placementId = "testad";
public bool testMode = true;
void Start()
{
Advertisement.Initialize(gameId, testMode);
StartCoroutine(ShowBannerWhenReady());
}
IEnumerator ShowBannerWhenReady()
{
while (!Advertisement.IsReady(placementId))
{
yield return new WaitForSeconds(0.5f);
}
Advertisement.Banner.Show(placementId);
Advertisement.GetPlacementState();
}
}
I am sure that placementid is linked, and it shows "Not Available" when I try to print Advertisement.GetPlacementState();
Any suggetions?
↧