- Home /
Question by
DevenValisten · Apr 14, 2020 at 05:24 PM ·
unity ads
need help about unity ads for play store
public static AdManager instance;
string android_id = "3532871";
string video_ad = "video";
string rewarded_video_ad = "rewardedVideo";
string banner_ad = "bannerAd";
bool testMode = true;
public GameObject adButton;
private void Awake()
{
if (instance == null)
{
instance = this;
DontDestroyOnLoad(gameObject);
}
else
Destroy(gameObject);
}
void Start()
{
Monetization.Initialize(android_id, testMode);
}
void Update()
{
if (SceneManager.GetActiveScene().name == "MainMenu")
{
if (Monetization.IsReady(rewarded_video_ad))
adButton.SetActive(true);
else
adButton.SetActive(false);
}
}
public void ShowAd()
{
if (Monetization.IsReady(video_ad))
{
ShowAdPlacementContent ad = null;
ad = Monetization.GetPlacementContent(video_ad) as ShowAdPlacementContent;
if (ad != null)
{
ad.Show();
}
}
}
My question is whether my script is correct, and do I have to change the bool testMode to false? I use bool testMode because I copied it from the unity website and my friend said he just let testMode remain true, but if I want to publish the game to the play store should the test mode be made false?
Comment