1using System.Collections.Generic;
2using System.Threading.Tasks;
25 public abstract bool Load();
38 while (!
Ad.CanShowAd())
45 public abstract void Show();
64 [field: SerializeField, Tooltip(
"Attach the ad unit component that this controller should manage.")]
65 protected T
AdUnit {
get;
private set; }
70 private static readonly Dictionary<string, T> adInstances =
new();
77 public T
this[
string id] => adInstances.GetValueOrDefault(
id);
79#pragma warning disable IDE0031
84 public override void Show()
96#pragma warning restore IDE0031
107 throw new UnityException($
"Ad object must include a component of type {nameof(UndestroyableUtility)} to ensure it is not inadvertently destroyed.");
110 if (!undestroyable.IsDestroyed)
124 throw new UnityException(
"Failed to assign an Ad object. Ensure the Ad object is properly initialized.");
T AdUnit
The ad unit component attached to this controller. It controls the ad's behavior and lifecycle.
virtual void OnApplicationQuit()
Performs clean-up actions when the application quits, such as unloading ad instances and clearing the...
override AdUnitBehaviourBase Ad
virtual void Awake()
Initializes the component during Unity's Awake callback.
AdUnitBehaviourBase Ad
The ad unit component attached to this controller. It controls the ad's behavior and lifecycle.
virtual int LoadAsyncPollingDelayMilliseconds
Delay between fallback asynchronous load readiness checks, in milliseconds. Derived controllers can o...
virtual async Task< bool > LoadAsync()
Loads the controlled ad unit asynchronously. Default implementation starts a regular load and waits u...
Base class for controlling ad units within Unity, providing the foundation for specific ad functional...
Base MonoBehaviour class for ad units. This class defines the abstract and virtual properties and met...
virtual string Id
The unique identifier for the object instance. It is serialized and can be viewed and modified in the...
Provides a base class for objects requiring a unique identifier, using MonoBehaviour as its foundatio...
A utility component to make an object persist across different scenes in a Unity project....