TowerBuildGame/Tower Build Game/Assets/Scripts/Ads.cs
Dvurechensky caa884e587 1.2
2025-05-12 05:50:37 +03:00

38 lines
801 B
C#

/*
* Author: Nikolay Dvurechensky
* Site: https://www.dvurechensky.pro/
* Gmail: dvurechenskysoft@gmail.com
* Last Updated: 12 мая 2025 05:48:46
* Version: 1.0.4
*/
using UnityEngine;
using UnityEngine.Advertisements;
using System.Collections;
public class Ads : MonoBehaviour
{
private string gameID = "4689491", type = "video";
private bool testMode = true;
private void Start()
{
Advertisement.Initialize(gameID, testMode);
Debug.Log(Advertisement.isInitialized);
StartCoroutine(ShowAd());
}
private IEnumerator ShowAd()
{
while (true)
{
if(Advertisement.IsReady(type))
{
Debug.Log("Ready");
}
yield return new WaitForSeconds(1f);
}
}
}