I keep reading that Unity is has been in the middle of changing things regarding the ads system. I along with others have been experiencing ads no longer working when previously they were working fine.
Currently I run Unity 5.2.5f1 as I’m still on XP and financially not able to upgrade my PC yet to use a newer version of Unity and that version is the last version that supports XP.
My ad code below (specific for Android only) has been working fine showing test ads in test mode but now shows nothing. I have only been running this script, no store asset package and things have been set up using the Services tab. It used to work, now it doesn’t. What do I need to do to fix this?
using System;
using UnityEngine;
using UnityEngine.Advertisements;
public class AdsAndroid : MonoBehaviour
{
public bool lvlLoading01 = false;
public bool lvlLoading02 = false;
void Start()
{
if (Advertisement.isSupported)
{
Advertisement.Initialize ("********", true); // my ID commented out for this post
Advertise();
}
else
{
Debug.Log("Platform not supported");
}
}
public void Advertise()
{
var showOptions = new ShowOptions
{
resultCallback = HandleShowResult
};
Advertisement.Show(null, showOptions);
}
private void HandleShowResult(ShowResult result)
{
switch (result)
{
case ShowResult.Finished:
LevelLoad ();
break;
case ShowResult.Skipped:
LevelLoad ();
break;
case ShowResult.Failed:
AdFailed ();
break;
}
}
public void AdFailed()
{
Application.LoadLevel("Ad_Fail");
}
public void LevelLoad()
{
if (lvlLoading01)
{
Application.LoadLevel("Loading01");
}
if (lvlLoading02)
{
Application.LoadLevel("Loading02");
}
}
}