public static void CheckInitialization() { if (!MobileAdsEventExecutor.IsActive()) { UnityEngine.Debug.Log("You intitialized an ad object but have not yet called MobileAds.Initialize(). We highly recommend you call MobileAds.Initialize() before interacting with the Google Mobile Ads SDK."); } MobileAdsEventExecutor.Initialize(); }
public static void Initialize() { if (!IsActive()) { GameObject gameObject = new GameObject("MobileAdsMainThreadExecuter"); gameObject.hideFlags = HideFlags.HideAndDontSave; UnityEngine.Object.DontDestroyOnLoad(gameObject); instance = gameObject.AddComponent <MobileAdsEventExecutor>(); } }
public static void Initialize() { if (IsActive()) { return; } // Add an invisible game object to the scene GameObject obj = new GameObject("MobileAdsMainThreadExecuter"); obj.hideFlags = HideFlags.HideAndDontSave; DontDestroyOnLoad(obj); instance = obj.AddComponent <MobileAdsEventExecutor>(); }
public void OnDisable() { instance = null; }