Exemple #1
0
 private void OnDestroy()
 {
     if (Instance == this)
     {
         Instance = null;
     }
 }
Exemple #2
0
        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
        }