I was Trying to implement Adcolony into my unity project and this error has appeared. I hope someone can help me.
**The variables are:**
string[] zoneIds = new string[] { "vz150fd4742f8f4281a1", "vz3bea056c072d437287" };
string APP_ID = "appbdca0d68df44424f90";
AdColony.AppOptions options = new AdColony.AppOptions();
**My Start() function is :**
private void Start()
{
Debug.Log(APP_ID);
Debug.Log(zoneIds[0]+" "+zoneIds[1]);
if (Application.platform == RuntimePlatform.Android ||
Application.platform == RuntimePlatform.IPhonePlayer)
{
AdColony.Ads.Configure(APP_ID, null, zoneIds);
}
}
**My OnMouseDown() function is :**
public void OnMouseDown()
{
AdColony.AdOptions adOptions = new AdColony.AdOptions();
adOptions.ShowPrePopup = false;
adOptions.ShowPostPopup = false;
AdColony.Ads.RequestInterstitialAd(zoneIds[0], adOptions);
AdColony.Ads.OnRequestInterstitial += (AdColony.InterstitialAd ad) =>
{
StartCoroutine(addAds());
gameObject.GetComponent().enabled = true;
gameObject.GetComponent().enabled = true;
todayEarnings.enabled = true;
totalEarnings.enabled = true;
Destroy(Loading);
};
AdColony.Ads.OnExpiring += (AdColony.InterstitialAd ad) => {
AdColony.Ads.RequestInterstitialAd(ad.ZoneId, adOptions);
};
AdColony.Ads.OnRewardGranted += (string zoneId, bool success, string name, int amount) =>
{
SceneManager.LoadScene("playScene1");
};
AdColony.Ads.OnRequestInterstitialFailed += () =>
{
SceneManager.LoadScene("playScene1");
};
AdColony.Ads.OnOpened += (AdColony.InterstitialAd ad) =>
{
StartCoroutine(addAds());
gameObject.GetComponent().enabled = true;
gameObject.GetComponent().enabled = true;
todayEarnings.enabled = true;
totalEarnings.enabled = true;
Destroy(Loading);
};
AdColony.Ads.OnClosed += (AdColony.InterstitialAd ad) =>
{
SceneManager.LoadScene("playScene1");
};
}
↧