private void OnDestroy() { if (Instance == this) { Instance = null; } }
private void Awake() { if (Instance == null) { Instance = this; } #if OG_ADMOB #if UNITY_ANDROID MobileAds.Initialize(androidAdmobAppId); #elif UNITY_IOS MobileAds.Initialize(iOSAdmobAppId); #endif // Get singleton reward based video ad reference. rewardBasedVideo = RewardBasedVideoAd.Instance; // RewardBasedVideoAd is a singleton, so handlers should only be registered once. rewardBasedVideo.OnAdClosed += HandleRewardBasedVideoClosed; rewardBasedVideo.OnAdRewarded += HandleRewardBasedVideoRewarded; #endif }