2using System.Collections.Generic;
4using Unity.Services.LevelPlay;
20 public abstract partial class LevelPlayAdUnit<TAd> : AdUnit<TAd>
22 private SynchronizationContext unitySynchronizationContext;
25 [Tooltip(
"Placements enable you to control where and how ads are served within your app.")]
26 [HelpURLField(
"https://docs.unity.com/en-us/grow/levelplay/platform/settings/placements")]
27 private string placementName;
40 protected override string TestIOSId => GetRealId() ;
45 public string PlacementName => placementName != string.Empty ? placementName :
null;
56 protected sealed override void Awake()
59 unitySynchronizationContext = SynchronizationContext.Current;
100 var replaceLogValues =
new Dictionary<string, Func<string>>
103 {
"{time}", () =>
LoadTime?.ToString(System.Globalization.CultureInfo.CurrentCulture) },
104 {
"{loadingTimeMs}", () =>
LoadingTimeMs?.ToString(System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty },
105 {
"{loadTimeMs}", () =>
LoadingTimeMs?.ToString(System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty },
106 {
"{name}", () => name },
109 {
"{revenue}", () =>
ResponseInfo?.Revenue?.ToString() },
114 return new SpaceAdLogger(
this, replaceLogValues,
LogOptions.Channel, !
LogOptions.SuppressAllLogs);
TAd AdObject
The ad object associated with this unit. This property allows for direct interaction with the specifi...
string SystemAdTypeName
A convenient string representation of the system ad type, used primarily for logging and debugging pu...
virtual LogOptions LogOptions
void RegisterEventHandlers()
To further customize the behavior of your ad, you can hook into a number of events in the ad's lifecy...
override string TestAndroidId
void SetLoadingStartTime()
Saves the start time of an ad-loading request.
override bool SdkInitialized
LevelPlayAdInfo ResponseInfo
Contains detailed information about a LevelPlay advertisement, including its dimensions,...
DateTime? LoadTime
Date and time when the ad was loaded.
void ResetLoadingStartTime()
Clears the saved start time when an ad-loading request cannot be started.
override void Unload()
Unloads the ad.
override string TestIOSId
string PlacementName
Placements enable you to control where and how ads are served within your app.
override SpaceAdLogger InitLogger()
LevelPlay ad information listener documentation
override bool LoadInternal()
long? LoadingTimeMs
Gets the duration of the latest successful ad-loading request in milliseconds. Divide the value by 10...
TAd CreateAdObject()
Creates and returns a new instance of the ad object. Derived classes must implement this method to in...
void LoadAdInternal()
Executes the internal logic to load the ad. Derived classes must implement this method with the speci...
static bool Ready
Indicates whether the SDK has been initialized.