I have successfully implemented ads, but I cannot manage to find anything about setting the size of banners. My current code that I have used and successfully tried is:
public class BannerAdScript : MonoBehaviour
{
public string gameId = "1234567";
public string placementId = "bannerPlacement";
public bool testMode = true;
[SerializeField] BannerPosition _bannerPosition = BannerPosition.BOTTOM_CENTER;
void Start()
{
// Initialize the SDK if you haven't already done so:
Advertisement.Initialize(gameId, testMode);
StartCoroutine(ShowBannerWhenReady());
// Set the banner position:
Advertisement.Banner.SetPosition(_bannerPosition);
}
IEnumerator ShowBannerWhenReady()
{
while (!Advertisement.IsReady(placementId))
{
yield return new WaitForSeconds(0.5f);
}
Advertisement.Banner.Show(placementId);
}
}
How do I set the height in a banner ad?
↧