void OnEnable()
        {
            m_Launcher = (GameGrowthLauncher)target;

            m_Configuration = m_Launcher.configuration;
            m_GameGrowthEnvironmentWarning = GameGrowthEnvironmentValidator.GetVerboseWarning(m_Configuration.environment);

            m_DefaultConfiguration = serializedObject.FindProperty("m_DefaultConfiguration");

            m_StartAdjustManually          = serializedObject.FindProperty("m_StartAdjustManually");
            m_AdjustEventBuffering         = serializedObject.FindProperty("m_AdjustEventBuffering");
            m_AdjustSendInBackground       = serializedObject.FindProperty("m_AdjustSendInBackground");
            m_AdjustLaunchDeferredDeeplink = serializedObject.FindProperty("m_AdjustLaunchDeferredDeeplink");

            m_AdjustAndroidAppToken           = serializedObject.FindProperty("m_AdjustAndroidAppToken");
            m_AdjustAndroidPurchaseEventToken = serializedObject.FindProperty("m_AdjustAndroidPurchaseEventToken");
            m_AdjustIosAppToken           = serializedObject.FindProperty("m_AdjustIosAppToken");
            m_AdjustIosPurchaseEventToken = serializedObject.FindProperty("m_AdjustIosPurchaseEventToken");

            m_AdjustOverrideTokens     = serializedObject.FindProperty("m_AdjustOverrideTokens");
            m_AdjustUseSameToken       = serializedObject.FindProperty("m_AdjustUseSameToken");
            m_AdjustAppToken           = serializedObject.FindProperty("m_AdjustAppToken");
            m_AdjustPurchaseEventToken = serializedObject.FindProperty("m_AdjustPurchaseEventToken");

            m_AdjustLogLevel = serializedObject.FindProperty("m_AdjustLogLevel");

            m_AttributionChangedCallbackHandler = serializedObject.FindProperty("m_AttributionChangedCallbackHandler");
            m_AdImpressionHandler = serializedObject.FindProperty("m_AdImpressionHandler");
            m_TransactionHandler  = serializedObject.FindProperty("m_TransactionHandler");

            m_StartDeltaDnaManually = serializedObject.FindProperty("m_StartDeltaDnaManually");
            m_AdjustFold            = true;
            m_DdnaFold = true;

#if GAMEGROWTH_UNITY_MEDIATION || GAMEGROWTH_MOPUB
            m_MediationFold = true;
            m_UseDefaultImpressionTrackedHandler = serializedObject.FindProperty("m_UseDefaultImpressionTrackedHandler");
#endif

#if GAMEGROWTH_ADMOB
            m_AdMobFold          = true;
            m_AdMobConfiguration = AdMobConfiguration.LoadMainAsset();
#endif

#if GAMEGROWTH_FACEBOOK_SDK
            m_FacebookSdkFold          = true;
            m_StartFacebookSdkManually = serializedObject.FindProperty("m_StartFacebookSdkManually");
#endif

            // Synchronize the object and verify if the actual app token or purchase token are different (may be indicating an upgrade from older version)
            serializedObject.Update();
            if (IsAppTokenDifferent() || IsPurchaseEventTokenDifferent())
            {
                m_AdjustUseSameToken.boolValue = false;
                serializedObject.ApplyModifiedProperties();
            }
        }
Пример #2
0
        static void ApplyAdMobConfiguration(GameGrowthConfigurationAsset gameGrowthConfiguration)
        {
            var config = AdMobConfiguration.LoadMainAsset();

            if (config != null)
            {
                config.androidAppId = gameGrowthConfiguration.projectSummary.providers.admob.appId.androidValue;
                config.iOSAppId     = gameGrowthConfiguration.projectSummary.providers.admob.appId.iOSValue;

                EditorUtility.SetDirty(config);
            }
        }
Пример #3
0
    private void Start()
    {
        AdMobConfiguration adc = new AdMobConfiguration();

        //========= Android key ===========================//
        adc.Android_AppID          = "ca-app-pub-8487108797721179~5373911102";
        adc.Android_BannerID       = "ca-app-pub-8487108797721179/8806368582";
        adc.Android_InterstitialID = "ca-app-pub-8487108797721179/5988633555";
        adc.Android_VideoRewordID  = "ca-app-pub-8487108797721179/7110143530";

        //========= IOS key ===========================//


        adsManager = new AdMobManager(adc);
        adsManager.AdMobRequest();

        AdMobVideoAds.onVideoLoaded          += HandleRewardBasedVideoLoaded;
        AdMobVideoAds.onVideoOpened          += HandleRewardBasedVideoOpened;
        AdMobVideoAds.onVideoRewarded        += HandleRewardBasedVideoRewarded;
        AdMobVideoAds.onVideoStarted         += HandleRewardBasedVideoStarted;
        AdMobVideoAds.onVideoFailedToLoad    += HandleRewardBasedVideoFailedToLoad;
        AdMobVideoAds.onVideoLeftApplication += HandleRewardBasedVideoLeftApplication;
        AdMobVideoAds.onVideoClosed          += HandleRewardBasedVideoClosed;

        AdMobBanner.onAdLoaded             += HandleOnAdLoaded;
        AdMobBanner.onAdFailedToLoad       += HandleOnAdFailedToLoad;
        AdMobBanner.onAdOpening            += HandleOnAdOpened;
        AdMobBanner.onAdClosed             += HandleOnAdClosed;
        AdMobBanner.onAdLeavingApplication += HandleOnAdLeavingApplication;

        AdMobInterstitail.onAdClosed             += HandleInterstitialClosed;
        AdMobInterstitail.onAdFailedToLoad       += HandleInterstitialFailedToLoad;
        AdMobInterstitail.onAdLoaded             += HandleInterstitialLoaded;
        AdMobInterstitail.onAdOpening            += HandleInterstitialOpened;
        AdMobInterstitail.onAdLeavingApplication += HandleInterstitialLeftApplication;
    }