public static void Initialize()
 {
     if (UnityEngine.Application.isEditor)
     {
         GameAnalyticsSDK.GameAnalytics._hasInitializeBeenCalled = true;
         return;
     }
     GA_Wrapper.Initialize("ab258be05882d64cb4e285ac8e8110f2", "e9e34daf4b7aff6505eccfc99eef811136b4c96c");
     GameAnalyticsSDK.GameAnalytics._hasInitializeBeenCalled = true;
 }
Пример #2
0
 public static void Initialize()
 {
     if (Application.get_isEditor())
     {
         GameAnalytics._hasInitializeBeenCalled = true;
     }
     else
     {
         GA_Wrapper.Initialize("ab258be05882d64cb4e285ac8e8110f2", "e9e34daf4b7aff6505eccfc99eef811136b4c96c");
         GameAnalytics._hasInitializeBeenCalled = true;
     }
 }
Пример #3
0
        public static void Initialize()
        {
            int platformIndex = GetPlatformIndex();

            if (platformIndex >= 0)
            {
                GA_Wrapper.Initialize(SettingsGA.GetGameKey(platformIndex), SettingsGA.GetSecretKey(platformIndex));
            }
            else
            {
                Debug.LogWarning("GameAnalytics: Unsupported platform (events will not be sent in editor; or missing platform in settings): " + Application.platform);
            }
        }
Пример #4
0
 /// <summary>
 /// Sets the custom identifier.
 /// </summary>
 /// <param name="userId">User identifier.</param>
 public static void SetCustomId(string userId)
 {
     if (SettingsGA.UseCustomId)
     {
         Debug.Log("Initializing with custom id: " + userId);
         GA_Wrapper.SetCustomUserId(userId);
         int index = (int)GetPlatform();
         GA_Wrapper.Initialize(SettingsGA.GetGameKey(index - 1), SettingsGA.GetSecretKey(index - 1));
     }
     else
     {
         Debug.LogWarning("Custom id is not enabled");
     }
 }
Пример #5
0
        // custome method
        public static void InitializeWithKeys(string gamekey, string gamesecret)
        {
            int platformIndex = GetPlatformIndex();

            if (platformIndex >= 0)
            {
                GA_Wrapper.Initialize(gamekey, gamesecret);
                GameAnalytics._hasInitializeBeenCalled = true;
            }
            else
            {
                GameAnalytics._hasInitializeBeenCalled = true;
                Debug.LogWarning("GameAnalytics: Unsupported platform (events will not be sent in editor; or missing platform in settings): " + Application.platform);
            }
        }
Пример #6
0
 /// <summary>
 /// Sets the custom identifier.
 /// </summary>
 /// <param name="userId">User identifier.</param>
 public static void SetCustomId(string userId)
 {
     if (SettingsGA.UseCustomId)
     {
         Debug.Log("Initializing with custom id: " + userId);
         GA_Wrapper.SetCustomUserId(userId);
         int index = GetPlatformIndex();
         if (index >= 0)
         {
             GA_Wrapper.Initialize(SettingsGA.GetGameKey(index), SettingsGA.GetSecretKey(index));
         }
         else
         {
             Debug.LogWarning("Unsupported platform (or missing platform in settings): " + Application.platform);
         }
     }
     else
     {
         Debug.LogWarning("Custom id is not enabled");
     }
 }
Пример #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);
            }

            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);
            }
        }
Пример #8
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);
            }
        }
Пример #9
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);
            }
        }
Пример #10
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);
            }
        }