示例#1
0
        protected override void InternalInit()
        {
#if EM_ADMOB
            mAdSettings = EM_Settings.Advertising.AdMob;

            // Set GDPR consent if any.
            var consent = GetApplicableDataPrivacyConsent();
            ApplyDataPrivacyConsent(consent);

            MobileAds.Initialize(mAdSettings.AppId.Id);

            mCustomBannerAds       = new Dictionary <AdPlacement, KeyValuePair <BannerAdSize, BannerView> >();
            mCustomInterstitialAds = new Dictionary <AdPlacement, InterstitialAd>();

            if (mAdSettings.EnableTestMode)
            {
#if UNITY_ANDROID
                testDeviceID = SystemInfo.deviceUniqueIdentifier.ToUpper();
#elif UNITY_IOS
                testDeviceID = UnityEngine.iOS.Device.advertisingIdentifier;
                testDeviceID = CreateMD5(testDeviceID);
                testDeviceID = testDeviceID.ToLower();
#endif
            }

            mIsInitialized = true;

            Debug.Log("AdMob client has been initialized.");
#endif
        }
        protected override void InternalInit()
        {
            #if EM_ADMOB
            mAdSettings = EM_Settings.Advertising.AdMob;

            // Set GDPR consent if any.
            var consent = GetApplicableDataPrivacyConsent();
            ApplyDataPrivacyConsent(consent);

            MobileAds.Initialize(mAdSettings.AppId.Id);

            mCustomBannerAds       = new Dictionary <AdPlacement, KeyValuePair <BannerAdSize, BannerView> >();
            mCustomInterstitialAds = new Dictionary <AdPlacement, InterstitialAd>();

            mIsInitialized = true;

            Debug.Log("AdMob client has been initialized.");
            #endif
        }