0

Help Unity Monobehaviour problem "No Monobehaviour scripts in the file, or their names don't match the file"

#if UNITY_ADS using UnityEngine; using System.Collections; using UnityEngine.Advertisements; /// <summary> /// This script handles all UnityAds functions, calling an ad after a certain number of level loads, or showing a rewarded ad /// </summary> public class PUPUnityAds : MonoBehaviour { public float minutes = 5; static float lastAdTime = 0; public void Awake() { // If enough time passed since the last ad, show a new ad if ( Time.realtimeSinceStartup > lastAdTime + minutes * 60 ) { ShowAd(); } } /// <summary> /// Shows the ad if it's ready, and resets the timer for the next ad /// </summary> public void ShowAd() { if ( Advertisement.IsReady() ) { Advertisement.Show(); lastAdTime = Time.realtimeSinceStartup; } } } #endif

18th Oct 2020, 2:13 PM
Bogdan Constantin
Bogdan Constantin - avatar
1 Respuesta
0
I dont know if something is wrong, or if i have to remove something
18th Oct 2020, 2:14 PM
Bogdan Constantin
Bogdan Constantin - avatar