Class LevelPlayRewardedAd
Implements ILevelPlayRewardedAd to provide functionality for managing rewarded ads.
Inherited Members
Namespace: Unity.Services.LevelPlay
Assembly: Unity.LevelPlay.dll
Syntax
public class LevelPlayRewardedAd : ILevelPlayRewardedAd, IDisposable
Constructors
LevelPlayRewardedAd(string)
Creates and Initializes a new instance of the LevelPlay Rewarded Ad.
Declaration
public LevelPlayRewardedAd(string adUnitId)
Parameters
Type | Name | Description |
---|---|---|
string | adUnitId | The unique ID for the ad unit. |
Properties
AdUnitId
Gets the ad unit id of the ad.
Declaration
public string AdUnitId { get; }
Property Value
Type | Description |
---|---|
string |
Methods
DestroyAd()
Destroys the Rewarded Ad.
Declaration
public void DestroyAd()
Dispose()
Dispose the rewarded ad
Declaration
public void Dispose()
GetAdId()
Gets the ad ID associated with this ad.
Declaration
public string GetAdId()
Returns
Type | Description |
---|---|
string | The ID of the ad. |
IsAdReady()
Checks if the Rewarded ad is ready
Declaration
public bool IsAdReady()
Returns
Type | Description |
---|---|
bool | Returns true if the Rewarded ad is ready, returns false if not. |
IsPlacementCapped(string)
Checks if a given Placement Name is capped.
Declaration
public static bool IsPlacementCapped(string placementName)
Parameters
Type | Name | Description |
---|---|---|
string | placementName | Placement Name for the Rewarded Ad. |
Returns
Type | Description |
---|---|
bool | Returns true if placement is capped, returns false if not. |
LoadAd()
Loads the Rewarded Ad.
Declaration
public void LoadAd()
ShowAd(string)
Shows the Rewarded Ad.
Declaration
public void ShowAd(string placementName = null)
Parameters
Type | Name | Description |
---|---|---|
string | placementName | (Optional) Placement Name for the Rewarded Ad. |
Events
OnAdClicked
Invoked when the user clicks on the Rewarded ad.
Declaration
public event Action<LevelPlayAdInfo> OnAdClicked
Event Type
Type | Description |
---|---|
Action<Level |
OnAdClosed
Invoked when the Rewarded ad is closed.
Declaration
public event Action<LevelPlayAdInfo> OnAdClosed
Event Type
Type | Description |
---|---|
Action<Level |
OnAdDisplayFailed
Invoked when the Rewarded ad fails to display.
Declaration
public event Action<LevelPlayAdDisplayInfoError> OnAdDisplayFailed
Event Type
Type | Description |
---|---|
Action<Level |
OnAdDisplayed
Invoked when the Rewarded ad is displayed.
Declaration
public event Action<LevelPlayAdInfo> OnAdDisplayed
Event Type
Type | Description |
---|---|
Action<Level |
OnAdInfoChanged
Invoked when the Rewarded ad info is changed.
Declaration
public event Action<LevelPlayAdInfo> OnAdInfoChanged
Event Type
Type | Description |
---|---|
Action<Level |
OnAdLoadFailed
Invoked when the Rewarded ad fails to load.
Declaration
public event Action<LevelPlayAdError> OnAdLoadFailed
Event Type
Type | Description |
---|---|
Action<Level |
OnAdLoaded
Invoked when the Rewarded ad is loaded.
Declaration
public event Action<LevelPlayAdInfo> OnAdLoaded
Event Type
Type | Description |
---|---|
Action<Level |
OnAdRewarded
Invoked when the Rewarded ad receives a reward.
Declaration
public event Action<LevelPlayAdInfo, LevelPlayReward> OnAdRewarded
Event Type
Type | Description |
---|---|
Action<Level |