Integrasi Persatuan Appodeal
using UnityEngine;
using AppodealAds.Unity.Api;
using AppodealAds.Unity.Common;
public class AdManager : MonoBehaviour, IRewardedVideoAdListener {
int timesTriedToShowInterstitial = 0;
// Use this for initialization
void Start () {
string appKey = "Put your app key here.";
Appodeal.disableLocationPermissionCheck();
Appodeal.setTesting(true);
Appodeal.initialize(appKey, Appodeal.INTERSTITIAL | Appodeal.BANNER | Appodeal.REWARDED_VIDEO);
Appodeal.setRewardedVideoCallbacks(this);
}
public void ShowBanner()
{
if (Appodeal.isLoaded(Appodeal.BANNER))
Appodeal.show(Appodeal.BANNER_TOP);
}
public void HideBanner()
{
Appodeal.hide(Appodeal.BANNER);
}
public void ShowInterstitial()
{
timesTriedToShowInterstitial++;
if (Appodeal.isLoaded(Appodeal.INTERSTITIAL) && timesTriedToShowInterstitial >= 5)
{
Appodeal.show(Appodeal.INTERSTITIAL);
timesTriedToShowInterstitial = 0;
}
}
public void ShowRewarded()
{
if (Appodeal.isLoaded(Appodeal.REWARDED_VIDEO))
Appodeal.show(Appodeal.REWARDED_VIDEO);
}
public void onRewardedVideoLoaded() { }
public void onRewardedVideoFailedToLoad() { }
public void onRewardedVideoShown() { }
public void onRewardedVideoClosed() { }
public void onRewardedVideoFinished(int amount, string name) { ManagerScript.Instance.Coins++; }
}
Kevin Tanyi