You've already forked Commercialization.topon
update 1.1.25
This commit is contained in:
79
AnyThinkPlugin/AnyThinkAds/Api/ATRewardedVideo.cs
Normal file
79
AnyThinkPlugin/AnyThinkAds/Api/ATRewardedVideo.cs
Normal file
@@ -0,0 +1,79 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using System.Reflection;
|
||||
using System;
|
||||
|
||||
using AnyThinkAds.Common;
|
||||
using AnyThinkAds.ThirdParty.LitJson;
|
||||
|
||||
|
||||
namespace AnyThinkAds.Api
|
||||
{
|
||||
public class ATRewardedVideo
|
||||
{
|
||||
private static readonly ATRewardedVideo instance = new ATRewardedVideo();
|
||||
public IATRewardedVideoAdClient client;
|
||||
|
||||
private ATRewardedVideo()
|
||||
{
|
||||
client = GetATRewardedClient();
|
||||
}
|
||||
|
||||
public static ATRewardedVideo Instance
|
||||
{
|
||||
get
|
||||
{
|
||||
return instance;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/***
|
||||
*
|
||||
*/
|
||||
public void loadVideoAd(string placementId, Dictionary<string,string> pairs)
|
||||
{
|
||||
client.loadVideoAd(placementId, JsonMapper.ToJson(pairs));
|
||||
}
|
||||
|
||||
|
||||
public bool hasAdReady(string placementId)
|
||||
{
|
||||
return client.hasAdReady(placementId);
|
||||
}
|
||||
|
||||
public void entryScenarioWithPlacementID(string placementId, string scenarioID)
|
||||
{
|
||||
client.entryScenarioWithPlacementID(placementId,scenarioID);
|
||||
}
|
||||
|
||||
public string checkAdStatus(string placementId)
|
||||
{
|
||||
return client.checkAdStatus(placementId);
|
||||
}
|
||||
|
||||
public string getValidAdCaches(string placementId)
|
||||
{
|
||||
return client.getValidAdCaches(placementId);
|
||||
}
|
||||
|
||||
public void showAd(string placementId)
|
||||
{
|
||||
client.showAd(placementId, JsonMapper.ToJson(new Dictionary<string, string>()));
|
||||
}
|
||||
|
||||
public void showAd(string placementId, Dictionary<string, string> pairs)
|
||||
{
|
||||
client.showAd(placementId, JsonMapper.ToJson(pairs));
|
||||
}
|
||||
|
||||
public IATRewardedVideoAdClient GetATRewardedClient()
|
||||
{
|
||||
return AnyThinkAds.ATAdsClientFactory.BuildRewardedVideoAdClient();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user