Interface ILevelPlayRewardedAd
APIs for LevelPlay Rewarded Ad in the Unity package.
Inherited Members
Namespace: Unity.Services.LevelPlay
Assembly: Unity.LevelPlay.dll
Syntax
public interface ILevelPlayRewardedAd : IDisposable
Properties
AdUnitId
Gets the ad unit id of the ad.
Declaration
string AdUnitId { get; }
Property Value
| Type | Description |
|---|---|
| string |
Methods
DestroyAd()
Destroys the Rewarded Ad.
Declaration
void DestroyAd()
GetAdId()
Gets the ad ID associated with this ad.
Declaration
string GetAdId()
Returns
| Type | Description |
|---|---|
| string | The ID of the ad. |
GetReward(string)
Retrieves the reward associated with the ad. Use this method to obtain the reward configured for the ad unit or placement. The placement-specific reward takes precedence over the ad unit reward when a valid placement name is provided.
Declaration
LevelPlayReward GetReward(string placement)
Parameters
| Type | Name | Description |
|---|---|---|
| string | placement | The placement name to retrieve the reward for, or null to use the ad unit's reward. |
Returns
| Type | Description |
|---|---|
| LevelPlayReward | A LevelPlayReward object. Returns an empty reward on failures (name: "" and amount: 0). |
IsAdReady()
Checks if the Rewarded ad is ready
Declaration
bool IsAdReady()
Returns
| Type | Description |
|---|---|
| bool | Returns true if the Rewarded ad is ready, returns false if not. |
LoadAd()
Loads the Rewarded Ad.
Declaration
void LoadAd()
ShowAd(string)
Shows the Rewarded Ad.
Declaration
void ShowAd(string placementName = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | placementName | (Optional) Placement Name for the Rewarded Ad. |
Events
OnAdClicked
Invoked when the Rewarded ad when the user clicks on the ad.
Declaration
event Action<LevelPlayAdInfo> OnAdClicked
Event Type
| Type | Description |
|---|---|
| Action<LevelPlayAdInfo> |
OnAdClosed
Invoked when the Rewarded ad is closed.
Declaration
event Action<LevelPlayAdInfo> OnAdClosed
Event Type
| Type | Description |
|---|---|
| Action<LevelPlayAdInfo> |
OnAdDisplayFailed
Invoked when the Rewarded ad fails to display.
Declaration
event Action<LevelPlayAdInfo, LevelPlayAdError> OnAdDisplayFailed
Event Type
| Type | Description |
|---|---|
| Action<LevelPlayAdInfo, LevelPlayAdError> |
OnAdDisplayed
Invoked when the Rewarded ad is displayed.
Declaration
event Action<LevelPlayAdInfo> OnAdDisplayed
Event Type
| Type | Description |
|---|---|
| Action<LevelPlayAdInfo> |
OnAdInfoChanged
Invoked when the Rewarded ad info is changed.
Declaration
event Action<LevelPlayAdInfo> OnAdInfoChanged
Event Type
| Type | Description |
|---|---|
| Action<LevelPlayAdInfo> |
OnAdLoadFailed
Invoked when the Rewarded ad fails to load.
Declaration
event Action<LevelPlayAdError> OnAdLoadFailed
Event Type
| Type | Description |
|---|---|
| Action<LevelPlayAdError> |
OnAdLoaded
Invoked when the Rewarded ad is loaded.
Declaration
event Action<LevelPlayAdInfo> OnAdLoaded
Event Type
| Type | Description |
|---|---|
| Action<LevelPlayAdInfo> |
OnAdRewarded
Invoked when the Rewarded ad receives a reward.
Declaration
event Action<LevelPlayAdInfo, LevelPlayReward> OnAdRewarded
Event Type
| Type | Description |
|---|---|
| Action<LevelPlayAdInfo, LevelPlayReward> |