2using UnityEngine.Events;
3using UnityEngine.Serialization;
18 [Tooltip(
"Invoked when an ad load fails or ad content fails to load, passing the error message as a string.")]
19 [FormerlySerializedAs(
"OnErrorCallback")]
23 [Tooltip(
"Invoked when an ad successfully loads.")]
24 [FormerlySerializedAs(
"OnLoadedCallback")]
28 [Tooltip(
"Invoked when an ad is clicked.")]
29 [FormerlySerializedAs(
"OnClickedCallback")]
33 [Tooltip(
"Invoked when an ad is shown.")]
34 [FormerlySerializedAs(
"OnOpenedCallback")]
35 [FormerlySerializedAs(
"OnShownCallback")]
39 [Tooltip(
"Invoked when an ad is closed.")]
40 [FormerlySerializedAs(
"OnClosedCallback")]
41 [FormerlySerializedAs(
"OnDismissedCallback")]
77 protected override void ValidateMessageOptions(
AdUnitBase adUnit)
83 Debug.LogWarning(
"To receive load or content failure events," +
84 "set the AdLoadFailed option and/or the AdContentFailed option to true." +
85 "These options can be configured in the MessageOptions parameter of the AdUnit component.",
this);
101 protected virtual bool CheckByEventCount(UnityEvent unityEvent,
bool value)
102 => ValidateType == MessageValidateType.Full
103 ? unityEvent?.GetPersistentEventCount() > 0
104 : unityEvent?.GetPersistentEventCount() > 0 || value;
Facilitates automatic validation and configuration of ad callback message options within Unity Editor...
virtual void AdContentFailed(object error)
Invoked when an ad content fails, passing the error message as a string.
UnityEvent ShownEvent
Invoked when an ad is shown.
UnityEvent ClickEvent
Invoked when an ad is clicked.
UnityEvent< string > FailedEvent
Invoked when an ad load fails or ad content fails to load, passing the error message as a string.
virtual void AdLoaded()
Invoked when an ad successfully loads.
UnityEvent LoadEvent
Invoked when an ad successfully loads.
virtual void AdLoadFailed(object error)
Invoked when an ad load fails, passing the error message as a string.
UnityEvent CloseEvent
Invoked when an ad is closed.
virtual void AdClosed()
Invoked when an ad is closed.
virtual void AdShown()
Invoked when an ad is shown.
virtual void AdClicked()
Invoked when an ad is clicked.
Serves as an abstract base class for dispatching events related to the lifecycle of advertisements,...
MessageOptions MessageOptions
Options for enabling Unity SendMessage methods.
Base class for ad units. This class defines the abstract and virtual properties and methods that are ...
bool AdClosed
Enables the callback for when an ad is closed by the user.
bool AdShown
Enables the callback for when an ad is shown.
bool AdLoadFailed
Enables the callback for when an ad fails to load, with an error parameter.
bool AdClicked
Enables the callback for when an ad is clicked.
bool AdLoaded
Enables the callback for when an ad successfully loads.
bool AdContentFailed
Enables the callback for when an ad fails to present content.
Defines the callback invoked when an ad is clicked.
Interface defining the method to be invoked when an ad is closed by the user.
Interface defining the method to be invoked when an ad fails to present content, with an error parame...
Interface defining the method to be invoked when an ad fails to load, with an error parameter.
Defines the callback invoked when an ad loads.
Interface defining the method to be invoked when an ad is shown.