protected override void OnInspectorGUI(UnityEngine.UI.Windows.Plugins.Heatmap.Core.HeatmapSettings settings, AnalyticsServiceItem item, System.Action onReset, GUISkin skin) { UnityEditor.EditorGUILayout.HelpBox("To enable Google Analytics download version V3 from official site.", UnityEditor.MessageType.Info); if (GUILayout.Button("Open Link", skin.button) == true) { Application.OpenURL("https://github.com/googleanalytics/google-analytics-plugin-for-unity/raw/master/googleanalyticsv3.unitypackage"); } }
protected override void OnInspectorGUI(UnityEngine.UI.Windows.Plugins.Heatmap.Core.HeatmapSettings settings, AnalyticsServiceItem item, System.Action onReset, GUISkin skin) { var found = false; if (foundType == false) { var assemblies = System.AppDomain.CurrentDomain.GetAssemblies(); foreach (var ass in assemblies) { var type = ass.GetTypes().FirstOrDefault(x => x.Name == "FB" && x.Namespace == "Facebook.Unity"); if (type != null) { found = true; foundType = true; break; } } } else { found = foundType; } if (found == false) { UnityEditor.EditorGUILayout.HelpBox("To enable Facebook Analytics go to Facebook Developer Portal and import FacebookSDK.", UnityEditor.MessageType.Warning); if (GUILayout.Button("Open Link", skin.button) == true) { Application.OpenURL("https://developers.facebook.com/docs/unity"); } } else { #if FACEBOOK_ANALYTICS_API UnityEditor.EditorGUILayout.HelpBox("Facebook Analytics is enabled.", UnityEditor.MessageType.Info); #else UnityEditor.EditorGUILayout.HelpBox("Facebook Analytics is disabled. To enable, please add `FACEBOOK_ANALYTICS_API` to your project build settings `Scripting Define Symbols`.", UnityEditor.MessageType.Warning); #endif } }
protected override void OnInspectorGUI(UnityEngine.UI.Windows.Plugins.Heatmap.Core.HeatmapSettings settings, AnalyticsServiceItem item, System.Action onReset, GUISkin skin) { var found = false; if (this.foundType == false) { var assemblies = System.AppDomain.CurrentDomain.GetAssemblies(); foreach (var ass in assemblies) { var type = ass.GetTypes().FirstOrDefault(x => x.Name == "GoogleAnalyticsV4"); if (type != null) { found = true; this.foundType = true; break; } } } else { found = this.foundType; } if (found == false) { UnityEditor.EditorGUILayout.HelpBox("Google Analytics is disabled. To enable Google Analytics download version from official github repo.", UnityEditor.MessageType.Warning); if (GUILayout.Button("Open Link", skin.button) == true) { Application.OpenURL("https://github.com/googleanalytics/google-analytics-plugin-for-unity"); } } else { #if GOOGLE_ANALYTICS_V4 UnityEditor.EditorGUILayout.HelpBox("Google Analytics is enabled.", UnityEditor.MessageType.Info); #else UnityEditor.EditorGUILayout.HelpBox("Google Analytics is disabled. To enable, please add `GOOGLE_ANALYTICS_V4` to your project build settings `Scripting Define Symbols`.", UnityEditor.MessageType.Warning); #endif } }
protected override void OnInspectorGUI(UnityEngine.UI.Windows.Plugins.Heatmap.Core.HeatmapSettings settings, AnalyticsServiceItem item, System.Action onReset, GUISkin skin) { var found = false; if (foundType == false) { var assemblies = System.AppDomain.CurrentDomain.GetAssemblies(); foreach (var ass in assemblies) { var type = ass.GetTypes().FirstOrDefault(x => x.Name == "DDNA" && x.Namespace == "DeltaDNA"); if (type != null) { found = true; foundType = true; break; } } } else { found = foundType; } if (found == false) { UnityEditor.EditorGUILayout.HelpBox("To enable DeltaDNA Analytics go to DeltaDNA web site and download Unity SDK.", UnityEditor.MessageType.Warning); if (GUILayout.Button("Open Link", skin.button) == true) { Application.OpenURL("http://docs.deltadna.com/advanced-integration/unity-sdk/"); } } else { #if DELTADNA_ANALYTICS_API UnityEditor.EditorGUILayout.HelpBox("DeltaDNA is enabled.", UnityEditor.MessageType.Info); #else UnityEditor.EditorGUILayout.HelpBox("DeltaDNA is disabled. To enable, please add `DELTADNA_ANALYTICS_API` to your project build settings `Scripting Define Symbols`.", UnityEditor.MessageType.Warning); #endif } }
protected override void OnInspectorGUI(UnityEngine.UI.Windows.Plugins.Heatmap.Core.HeatmapSettings settings, AnalyticsServiceItem item, System.Action onReset, GUISkin skin) { var found = false; if (this.foundType == false) { var assemblies = System.AppDomain.CurrentDomain.GetAssemblies(); foreach (var ass in assemblies) { var type = ass.GetTypes().FirstOrDefault(x => x.Name == "Analytics" && x.Namespace == "UnityEngine.Analytics"); if (type != null) { found = true; this.foundType = true; break; } } } else { found = this.foundType; } if (found == false) { UnityEditor.EditorGUILayout.HelpBox("To enable Unity Analytics open `Window/Unity Services` window, login there and turn on `Analytics`.", UnityEditor.MessageType.Warning); } else { #if UNITY_ANALYTICS_API UnityEditor.EditorGUILayout.HelpBox("Unity Analytics is enabled.", UnityEditor.MessageType.Info); #else UnityEditor.EditorGUILayout.HelpBox("Unity Analytics is disabled. To enable, please add `UNITY_ANALYTICS_API` to your project build settings `Scripting Define Symbols`.", UnityEditor.MessageType.Warning); #endif } }
protected override void OnInspectorGUI(UnityEngine.UI.Windows.Plugins.Heatmap.Core.HeatmapSettings settings, AnalyticsServiceItem item, System.Action onReset, GUISkin skin) { UnityEditor.EditorGUILayout.HelpBox("To enable Unity Analytics open `Window/Unity Services` window and login there.", UnityEditor.MessageType.Info); }
protected override void OnInspectorGUI(UnityEngine.UI.Windows.Plugins.Heatmap.Core.HeatmapSettings settings, AnalyticsServiceItem item, System.Action onReset, GUISkin skin) { var wasChanged = GUI.changed; GUI.changed = false; GUI.changed = item.userFilter.OnGUI(skin) || GUI.changed; CustomGUI.Splitter(); if (GUI.changed == true) { item.isChanged = true; } UnityEditor.EditorGUI.BeginDisabledGroup(!item.isChanged); if (GUILayout.Button("Apply", skin.button) == true) { item.isChanged = false; GUI.changed = true; if (onReset != null) { onReset.Invoke(); } } UnityEditor.EditorGUI.EndDisabledGroup(); UnityEditor.EditorGUI.BeginDisabledGroup(item.processing); { var newState = UnityEditor.EditorGUILayout.ToggleLeft(string.Format("Show {0}", (item.processing == true ? "(Processing...)" : string.Empty)), item.show); if (newState != item.show && item.processing == false) { item.processing = true; if (newState == true) { if (onReset != null) { onReset.Invoke(); } // Connecting this.OnEditorAuth(this.GetAuthKey(item), (result) => { UnityEditor.EditorApplication.delayCall += () => { Debug.Log("Stat Editor Connected!"); item.show = result; item.processing = false; }; }); UnityEditor.EditorApplication.delayCall += () => this.UpdateEditor(); } else { // Disconnecting this.OnEditorDisconnect((result) => { item.show = false; item.processing = false; if (onReset != null) { onReset.Invoke(); } }); UnityEditor.EditorApplication.delayCall += () => this.UpdateEditor(); } } } UnityEditor.EditorGUI.EndDisabledGroup(); if (GUI.changed == true) { UnityEditor.EditorUtility.SetDirty(settings); } GUI.changed = wasChanged; }