BannerControllerAnchoredAdaptive

Overview

Android-only anchored adaptive banner controller wired to a bannerVisible atom. The sample shows how to compute a safe width and load an anchored adaptive banner at the bottom of the screen.

Platform

  • Android only (#if UNITY_ANDROID).

Atoms / Inputs

  • BoolReference bannerVisible — becomes true when the banner loads; set false on disable.

Behavior

  • OnEnable() calls CreateAndLoad() (the sample code is provided but commented out for now).
  • OnDisable() destroys the banner and sets bannerVisible = false.

Anchored Adaptive (sample)

  • Compute safe width (dp) with MobileAds.Utils.GetDeviceSafeWidth().
  • Get size with AdSize.GetCurrentOrientationAnchoredAdaptiveBannerAdSizeWithWidth(widthDp).
  • Create BannerView with that size at AdPosition.Bottom and wire load/fail events.
  • Call LoadAd(new AdRequest()).

Ad Unit

  • Uses Google demo ad unit by default. Replace with your real ID for production.