Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Threading;
- using GoogleMobileAds.Api;
- using UnityEngine;
- public class GoogleAdsHandler : MonoBehaviour
- {
- private InterstitialAd _interstitial;
- public static SynchronizationContext MainThread;
- private void Awake()
- {
- MainThread = SynchronizationContext.Current;
- DontDestroyOnLoad(this);
- }
- private void Start()
- {
- if (GoogleAds.Instance.Initialized) return;
- MobileAds.Initialize(GoogleAds.Instance.InitCompleteAction);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment