You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
PlumberUltimateAds/Assets/IronSource/Scripts/IronSourceRewardedVideoLeve...

44 lines
1.4 KiB
C#

2 months ago
#if UNITY_ANDROID
using System;
using System.Collections.Generic;
using UnityEngine;
public class IronSourceRewardedVideoLevelPlayManualAndroid : AndroidJavaProxy, IUnityLevelPlayRewardedVideoManual
{
public IronSourceRewardedVideoLevelPlayManualAndroid() : base(IronSourceConstants.LevelPlayRewardedVideoManualBridgeListenerClass)
{
try
{
using (var pluginClass = new AndroidJavaClass(IronSourceConstants.bridgeClass))
{
var bridgeInstance = pluginClass.CallStatic<AndroidJavaObject>("getInstance");
bridgeInstance.Call("setUnityRewardedVideoManualLevelPlayListener", this);
}
}
catch (Exception e)
{
Debug.LogError("setUnityRewardedVideoManualLevelPlayListener method doesn't exist, error: " + e.Message);
}
}
public event Action<IronSourceError> OnAdLoadFailed = delegate { };
public event Action<IronSourceAdInfo> OnAdReady = delegate { };
void onAdReady(string data) {
if (this.OnAdReady != null) {
IronSourceAdInfo adInfo = new IronSourceAdInfo(data);
this.OnAdReady(adInfo);
}
}
void onAdLoadFailed(string args) {
if (this.OnAdLoadFailed!=null) {
IronSourceError err = IronSourceUtils.getErrorFromErrorObject(args);
this.OnAdLoadFailed(err);
}
}
}
#endif