コード例 #1
0
ファイル: AppLovinClientImpl.cs プロジェクト: artemy0/Quiz
        protected override void InternalInit()
        {
#if EM_APPLOVIN
            mAdSettings             = EM_Settings.Advertising.AppLovin;
            mCustomRewardedVideoAds = new List <AdPlacement>();
            mCustomInterstitialAds  = new List <AdPlacement>();
            mCustomBanners          = new Dictionary <AdPlacement, KeyValuePair <BannerAdPosition, BannerAdSize> >();

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

            AppLovin.SetSdkKey(mAdSettings.SDKKey);
            AppLovin.InitializeSdk();

            // Test Mode
            if (mAdSettings.EnableTestMode)
            {
                AppLovin.SetTestAdsEnabled("true");
            }
            else
            {
                AppLovin.SetTestAdsEnabled("false");
            }

            // Age-Restricted
            if (mAdSettings.AgeRestrictMode)
            {
                AppLovin.SetIsAgeRestrictedUser("true");
            }
            else
            {
                AppLovin.SetIsAgeRestrictedUser("false");
            }

            AppLovin.LoadRewardedInterstitial();

            // Setup Events Listener
            GameObject listener = new GameObject();
            listener.name = "EM_AppLovinAdsListenerObject";
            UnityEngine.Object.Instantiate(listener, Vector3.zero, Quaternion.identity);
            listener.AddComponent <EM_AppLovinAdsListener>();
            listener.GetComponent <EM_AppLovinAdsListener>().setAdClient(this);
            AppLovin.SetUnityAdListener("EM_AppLovinAdsListenerObject");

            // Done Initialization.
            mIsInitialized = true;
            Debug.Log("AppLovin client has been initialized.");
#endif
        }
コード例 #2
0
        protected override void InternalInit()
        {
#if EM_APPLOVIN
            mAdSettings     = EM_Settings.Advertising.AppLovin;
            mCreatedBanners = new Dictionary <AdPlacement, KeyValuePair <BannerAdPosition, BannerAdSize> >();

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

            MaxSdk.SetSdkKey(mAdSettings.SDKKey);
            MaxSdk.InitializeSdk();

            // Age-Restricted
            if (mAdSettings.AgeRestrictMode)
            {
                MaxSdk.SetIsAgeRestrictedUser(true);
            }
            else
            {
                MaxSdk.SetIsAgeRestrictedUser(false);
            }

            //Create ad unit event listener
            new InterstitialEvents(this);
            new RewardedAdEvents(this);
            new BannerEvents(this);

            LoadInterstitialAd();
            LoadRewardedAd();

            // Done Initialization.
            mIsInitialized = true;
            Debug.Log("AppLovin client has been initialized.");
#endif
        }