コード例 #1
0
        private static void InternalInitialize()
        {
            if (!Application.isPlaying)
            {
                return;
            }
            if (SettingsGA.InfoLogBuild)
            {
                GA_Setup.SetInfoLog(enabled: true);
            }
            if (SettingsGA.VerboseLogBuild)
            {
                GA_Setup.SetVerboseLog(enabled: true);
            }
            int platformIndex = GetPlatformIndex();

            GA_Wrapper.SetUnitySdkVersion("unity " + Settings.VERSION);
            GA_Wrapper.SetUnityEngineVersion("unity " + GetUnityVersion());
            if (platformIndex >= 0)
            {
                if (SettingsGA.UsePlayerSettingsBuildNumber)
                {
                    for (int i = 0; i < SettingsGA.Platforms.Count; i++)
                    {
                        if (SettingsGA.Platforms[i] == RuntimePlatform.Android || SettingsGA.Platforms[i] == RuntimePlatform.IPhonePlayer)
                        {
                            SettingsGA.Build[i] = Application.version;
                        }
                    }
                }
                GA_Wrapper.SetBuild(SettingsGA.Build[platformIndex]);
            }
            if (SettingsGA.CustomDimensions01.Count > 0)
            {
                GA_Setup.SetAvailableCustomDimensions01(SettingsGA.CustomDimensions01);
            }
            if (SettingsGA.CustomDimensions02.Count > 0)
            {
                GA_Setup.SetAvailableCustomDimensions02(SettingsGA.CustomDimensions02);
            }
            if (SettingsGA.CustomDimensions03.Count > 0)
            {
                GA_Setup.SetAvailableCustomDimensions03(SettingsGA.CustomDimensions03);
            }
            if (SettingsGA.ResourceItemTypes.Count > 0)
            {
                GA_Setup.SetAvailableResourceItemTypes(SettingsGA.ResourceItemTypes);
            }
            if (SettingsGA.ResourceCurrencies.Count > 0)
            {
                GA_Setup.SetAvailableResourceCurrencies(SettingsGA.ResourceCurrencies);
            }
            if (SettingsGA.UseManualSessionHandling)
            {
                SetEnabledManualSessionHandling(enabled: true);
            }
        }
コード例 #2
0
        private static void InternalInitialize()
        {
            if (!Application.isPlaying)
            {
                return; // no need to setup anything else if we are in the editor and not playing
            }
            if (SettingsGA.InfoLogBuild)
            {
                GA_Setup.SetInfoLog(true);
            }

            if (SettingsGA.VerboseLogBuild)
            {
                GA_Setup.SetVerboseLog(true);
            }

            int platformIndex = GetPlatformIndex();

            GA_Wrapper.SetUnitySdkVersion("unity " + Settings.VERSION);
            GA_Wrapper.SetUnityEngineVersion("unity " + GetUnityVersion());

            if (platformIndex >= 0)
            {
                GA_Wrapper.SetBuild(SettingsGA.Build [platformIndex]);
            }

            if (SettingsGA.CustomDimensions01.Count > 0)
            {
                GA_Setup.SetAvailableCustomDimensions01(SettingsGA.CustomDimensions01);
            }

            if (SettingsGA.CustomDimensions02.Count > 0)
            {
                GA_Setup.SetAvailableCustomDimensions02(SettingsGA.CustomDimensions02);
            }

            if (SettingsGA.CustomDimensions03.Count > 0)
            {
                GA_Setup.SetAvailableCustomDimensions03(SettingsGA.CustomDimensions03);
            }

            if (SettingsGA.ResourceItemTypes.Count > 0)
            {
                GA_Setup.SetAvailableResourceItemTypes(SettingsGA.ResourceItemTypes);
            }

            if (SettingsGA.ResourceCurrencies.Count > 0)
            {
                GA_Setup.SetAvailableResourceCurrencies(SettingsGA.ResourceCurrencies);
            }

            if (SettingsGA.UseManualSessionHandling)
            {
                SetEnabledManualSessionHandling(true);
            }
        }
コード例 #3
0
 private static void InternalInitialize()
 {
     if (!Application.get_isPlaying())
     {
         return;
     }
     if (GameAnalytics.SettingsGA.InfoLogBuild)
     {
         GA_Setup.SetInfoLog(true);
     }
     if (GameAnalytics.SettingsGA.VerboseLogBuild)
     {
         GA_Setup.SetVerboseLog(true);
     }
     GA_Wrapper.SetUnitySdkVersion("unity " + Settings.VERSION);
     GA_Wrapper.SetUnityEngineVersion("unity " + GameAnalytics.GetUnityVersion());
     GA_Wrapper.SetBuild(BuildInfo.get_Current().get_Scm().get_ChangeId());
     if (GameAnalytics.SettingsGA.CustomDimensions01.Count > 0)
     {
         GA_Setup.SetAvailableCustomDimensions01(GameAnalytics.SettingsGA.CustomDimensions01);
     }
     if (GameAnalytics.SettingsGA.CustomDimensions02.Count > 0)
     {
         GA_Setup.SetAvailableCustomDimensions02(GameAnalytics.SettingsGA.CustomDimensions02);
     }
     if (GameAnalytics.SettingsGA.CustomDimensions03.Count > 0)
     {
         GA_Setup.SetAvailableCustomDimensions03(GameAnalytics.SettingsGA.CustomDimensions03);
     }
     if (GameAnalytics.SettingsGA.ResourceItemTypes.Count > 0)
     {
         GA_Setup.SetAvailableResourceItemTypes(GameAnalytics.SettingsGA.ResourceItemTypes);
     }
     if (GameAnalytics.SettingsGA.ResourceCurrencies.Count > 0)
     {
         GA_Setup.SetAvailableResourceCurrencies(GameAnalytics.SettingsGA.ResourceCurrencies);
     }
     if (!GameAnalytics.SettingsGA.UseManualSessionHandling)
     {
         return;
     }
     GameAnalytics.SetEnabledManualSessionHandling(true);
 }
コード例 #4
0
        private static void Initialize()
        {
            if (!Application.isPlaying)
            {
                return;                 // no need to setup anything else if we are in the editor and not playing
            }
#if UNITY_EDITOR
            Debug.Log("GameAnalytics running in Unity Editor: event validation disabled.");
#endif

            if (SettingsGA.InfoLogBuild)
            {
                GA_Setup.SetInfoLog(true);
            }

            if (SettingsGA.VerboseLogBuild)
            {
                GA_Setup.SetVerboseLog(true);
            }

            int platformIndex = GetPlatformIndex();

            GA_Wrapper.SetUnitySdkVersion("unity " + Settings.VERSION);
            GA_Wrapper.SetUnityEngineVersion("unity " + GetUnityVersion());

            if (platformIndex >= 0)
            {
                GA_Wrapper.SetBuild(SettingsGA.Build[platformIndex]);
            }

            if (SettingsGA.CustomDimensions01.Count > 0)
            {
                GA_Setup.SetAvailableCustomDimensions01(SettingsGA.CustomDimensions01);
            }

            if (SettingsGA.CustomDimensions02.Count > 0)
            {
                GA_Setup.SetAvailableCustomDimensions02(SettingsGA.CustomDimensions02);
            }

            if (SettingsGA.CustomDimensions03.Count > 0)
            {
                GA_Setup.SetAvailableCustomDimensions03(SettingsGA.CustomDimensions03);
            }

            if (SettingsGA.ResourceItemTypes.Count > 0)
            {
                GA_Setup.SetAvailableResourceItemTypes(SettingsGA.ResourceItemTypes);
            }

            if (SettingsGA.ResourceCurrencies.Count > 0)
            {
                GA_Setup.SetAvailableResourceCurrencies(SettingsGA.ResourceCurrencies);
            }

            if (SettingsGA.UseManualSessionHandling)
            {
                SetEnabledManualSessionHandling(true);
            }

            if (platformIndex >= 0)
            {
                if (!SettingsGA.UseCustomId)
                {
                    GA_Wrapper.Initialize(SettingsGA.GetGameKey(platformIndex), SettingsGA.GetSecretKey(platformIndex));
                }
                else
                {
                    Debug.Log("Custom id is enabled. Initialize is delayed until custom id has been set.");
                }
            }
            else
            {
                Debug.LogWarning("Unsupported platform (or missing platform in settings): " + Application.platform);
            }
        }
コード例 #5
0
        // Token: 0x06000168 RID: 360 RVA: 0x0000B260 File Offset: 0x00009660
        private static void Initialize()
        {
            if (!Application.isPlaying)
            {
                return;
            }
            if (GameAnalytics.SettingsGA.InfoLogBuild)
            {
                GA_Setup.SetInfoLog(true);
            }
            if (GameAnalytics.SettingsGA.VerboseLogBuild)
            {
                GA_Setup.SetVerboseLog(true);
            }
            int platformIndex = GameAnalytics.GetPlatformIndex();

            GA_Wrapper.SetUnitySdkVersion("unity " + Settings.VERSION);
            GA_Wrapper.SetUnityEngineVersion("unity " + GameAnalytics.GetUnityVersion());
            if (platformIndex >= 0)
            {
                GA_Wrapper.SetBuild(GameAnalytics.SettingsGA.Build[platformIndex]);
            }
            if (GameAnalytics.SettingsGA.CustomDimensions01.Count > 0)
            {
                GA_Setup.SetAvailableCustomDimensions01(GameAnalytics.SettingsGA.CustomDimensions01);
            }
            if (GameAnalytics.SettingsGA.CustomDimensions02.Count > 0)
            {
                GA_Setup.SetAvailableCustomDimensions02(GameAnalytics.SettingsGA.CustomDimensions02);
            }
            if (GameAnalytics.SettingsGA.CustomDimensions03.Count > 0)
            {
                GA_Setup.SetAvailableCustomDimensions03(GameAnalytics.SettingsGA.CustomDimensions03);
            }
            if (GameAnalytics.SettingsGA.ResourceItemTypes.Count > 0)
            {
                GA_Setup.SetAvailableResourceItemTypes(GameAnalytics.SettingsGA.ResourceItemTypes);
            }
            if (GameAnalytics.SettingsGA.ResourceCurrencies.Count > 0)
            {
                GA_Setup.SetAvailableResourceCurrencies(GameAnalytics.SettingsGA.ResourceCurrencies);
            }
            if (GameAnalytics.SettingsGA.UseManualSessionHandling)
            {
                GameAnalytics.SetEnabledManualSessionHandling(true);
            }
            if (platformIndex >= 0)
            {
                if (!GameAnalytics.SettingsGA.UseCustomId)
                {
                    GA_Wrapper.Initialize(GameAnalytics.SettingsGA.GetGameKey(platformIndex), GameAnalytics.SettingsGA.GetSecretKey(platformIndex));
                }
                else
                {
                    Debug.Log("Custom id is enabled. Initialize is delayed until custom id has been set.");
                }
            }
            else
            {
                Debug.LogWarning("GameAnalytics: Unsupported platform (events will not be sent in editor; or missing platform in settings): " + Application.platform);
            }
        }
コード例 #6
0
        private static void Initialize()
        {
            if (!Application.isPlaying)
            {
                return;                 // no need to setup anything else if we are in the editor and not playing
            }
            if (SettingsGA.InfoLogBuild)
            {
                GA_Setup.SetInfoLog(true);
            }

            if (SettingsGA.VerboseLogBuild)
            {
                GA_Setup.SetVerboseLog(true);
            }

            int platformIndex = GetPlatformIndex();

            GA_Wrapper.SetUnitySdkVersion("unity " + Settings.VERSION);
            GA_Wrapper.SetUnityEngineVersion("unity " + GetUnityVersion());

            if (platformIndex >= 0)
            {
                if (GameAnalytics.SettingsGA.UsePlayerSettingsBuildNumber)
                {
                    for (int i = 0; i < GameAnalytics.SettingsGA.Platforms.Count; ++i)
                    {
                        if (GameAnalytics.SettingsGA.Platforms [i] == RuntimePlatform.Android || GameAnalytics.SettingsGA.Platforms [i] == RuntimePlatform.IPhonePlayer)
                        {
                            GameAnalytics.SettingsGA.Build [i] = Application.version;
                        }
                    }
                }
                GA_Wrapper.SetBuild(SettingsGA.Build [platformIndex]);
            }

            if (SettingsGA.CustomDimensions01.Count > 0)
            {
                GA_Setup.SetAvailableCustomDimensions01(SettingsGA.CustomDimensions01);
            }

            if (SettingsGA.CustomDimensions02.Count > 0)
            {
                GA_Setup.SetAvailableCustomDimensions02(SettingsGA.CustomDimensions02);
            }

            if (SettingsGA.CustomDimensions03.Count > 0)
            {
                GA_Setup.SetAvailableCustomDimensions03(SettingsGA.CustomDimensions03);
            }

            if (SettingsGA.ResourceItemTypes.Count > 0)
            {
                GA_Setup.SetAvailableResourceItemTypes(SettingsGA.ResourceItemTypes);
            }

            if (SettingsGA.ResourceCurrencies.Count > 0)
            {
                GA_Setup.SetAvailableResourceCurrencies(SettingsGA.ResourceCurrencies);
            }

            if (SettingsGA.UseManualSessionHandling)
            {
                SetEnabledManualSessionHandling(true);
            }

            if (platformIndex >= 0)
            {
                if (!SettingsGA.UseCustomId)
                {
                    GA_Wrapper.Initialize(SettingsGA.GetGameKey(platformIndex), SettingsGA.GetSecretKey(platformIndex));
                }
                else
                {
                    Debug.Log("Custom id is enabled. Initialize is delayed until custom id has been set.");
                }
            }
            else
            {
                Debug.LogWarning("GameAnalytics: Unsupported platform (events will not be sent in editor; or missing platform in settings): " + Application.platform);
            }
        }
コード例 #7
0
        private static void Initialize()
        {
            if (!Application.isPlaying)
            {
                return;                 // no need to setup anything else if we are in the editor and not playing
            }
                        #if UNITY_EDITOR
            Debug.Log("GameAnalytics running in Unity Editor: event validation disabled.");
                        #endif

            if (SettingsGA.InfoLogBuild)
            {
                GA_Setup.SetInfoLog(true);
            }

            if (SettingsGA.VerboseLogBuild)
            {
                GA_Setup.SetVerboseLog(true);
            }

#if UNITY_ANDROID && !UNITY_EDITOR
            AndroidJavaClass  jc       = new AndroidJavaClass("com.unity3d.player.UnityPlayer");
            AndroidJavaObject activity = jc.GetStatic <AndroidJavaObject>("currentActivity");

            AndroidJavaClass ga = new AndroidJavaClass("com.gameanalytics.sdk.GAPlatform");
            ga.CallStatic("initializeWithActivity", activity);
#endif

            GAPlatform platform = GetPlatform();

            GA_Wrapper.SetUnitySdkVersion("unity " + Settings.VERSION);
            GA_Wrapper.SetUnityEngineVersion("unity " + GetUnityVersion());

            if (platform != GAPlatform.None)
            {
                int index = (int)platform;
                GA_Wrapper.SetBuild(SettingsGA.Build[index - 1]);
            }

            if (SettingsGA.CustomDimensions01.Count > 0)
            {
                GA_Setup.SetAvailableCustomDimensions01(SettingsGA.CustomDimensions01);
            }

            if (SettingsGA.CustomDimensions02.Count > 0)
            {
                GA_Setup.SetAvailableCustomDimensions02(SettingsGA.CustomDimensions02);
            }

            if (SettingsGA.CustomDimensions03.Count > 0)
            {
                GA_Setup.SetAvailableCustomDimensions03(SettingsGA.CustomDimensions03);
            }

            if (SettingsGA.ResourceItemTypes.Count > 0)
            {
                GA_Setup.SetAvailableResourceItemTypes(SettingsGA.ResourceItemTypes);
            }

            if (SettingsGA.ResourceCurrencies.Count > 0)
            {
                GA_Setup.SetAvailableResourceCurrencies(SettingsGA.ResourceCurrencies);
            }

            if (platform != GAPlatform.None)
            {
                int index = (int)platform;
                GA_Wrapper.Initialize(SettingsGA.GetGameKey(index - 1), SettingsGA.GetSecretKey(index - 1));
            }
            else
            {
                Debug.LogWarning("Unsupported platform: " + Application.platform);
            }
        }