Quantcast
Channel: Questions in topic: "ads"
Viewing all articles
Browse latest Browse all 1416

Unity Advertisement is not working on the editor

$
0
0
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?

Viewing all articles
Browse latest Browse all 1416

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>