Exemplo n.º 1
0
        public void OnEnable()
        {
            pluginInfo.Add(new string[] { "Version: ", VersionInfo.VERSION });
            pluginInfo.Add(new string[] { "Build Date: ", VersionInfo.BUILD_DATE });
            pluginInfo.Add(new string[] { "Hash: ", VersionInfo.GIT_HASH });

            if (HvrPlayerInterface.Initialise())
            {
                hvrEngineInfo.Add(new string[] { "Version: ", HvrPlayerInterface.GetInfo("VERSION") });
                hvrEngineInfo.Add(new string[] { "Build Date: ", HvrPlayerInterface.GetInfo("BUILD_DATE") });
                hvrEngineInfo.Add(new string[] { "Hash: ", HvrPlayerInterface.GetInfo("GIT_HASH") });
            }

            about_info = "8i Unity Plugin:";

            for (int i = 0; i < pluginInfo.Count; i++)
            {
                about_info += "\n";
                about_info += pluginInfo[i][0] + pluginInfo[i][1];
            }
            about_info += "\n";

            about_info += "\n";
            about_info += "HVR Engine:";

            for (int i = 0; i < hvrEngineInfo.Count; i++)
            {
                about_info += "\n";
                about_info += hvrEngineInfo[i][0] + hvrEngineInfo[i][1];
            }

            EditorApplication.update -= Repaint;
            EditorApplication.update += Repaint;
        }
Exemplo n.º 2
0
        static void UpdateHvrInfo()
        {
            m_info["HVR_VersionInfo_VERSION"]    = VersionInfo.VERSION;
            m_info["HVR_VersionInfo_GIT_HASH"]   = VersionInfo.GIT_HASH;
            m_info["HVR_VersionInfo_GIT_BRANCH"] = VersionInfo.GIT_BRANCH;
            m_info["HVR_VersionInfo_BUILD_DATE"] = VersionInfo.BUILD_DATE;

            if (HvrPlayerInterface.Initialise())
            {
                m_info["HvrPlayerInterface_VERSION"]    = HvrPlayerInterface.GetInfo(HvrPlayerInterfaceAPI.Player_GetInfo_Keys.VERSION);
                m_info["HvrPlayerInterface_BUILD_DATE"] = HvrPlayerInterface.GetInfo(HvrPlayerInterfaceAPI.Player_GetInfo_Keys.BUILD_DATE);
                m_info["HvrPlayerInterface_GIT_HASH"]   = HvrPlayerInterface.GetInfo(HvrPlayerInterfaceAPI.Player_GetInfo_Keys.GIT_HASH);
            }
        }
        static AnalyticsManager()
        {
            if (UnityEditorInternal.InternalEditorUtility.inBatchMode)
            {
                return;
            }

            if (GetOptOut() == true)
            {
                return;
            }

            // Developer version, do not log
            if (HVR.VersionInfo.VERSION == "-1")
            {
                return;
            }

            // If the current process id is the same as last time, don't log any events
            // This suppresses analytics being sent after every code recompilation
            int currentID = System.Diagnostics.Process.GetCurrentProcess().Id;

            if (GetSessionID() == currentID)
            {
                return;
            }

            SetSessionID(currentID);

            LogEvent("AUTO", "INIT", "INIT", 0);
            LogEvent("INFO", "HVR_VERSION", HVR.VersionInfo.VERSION, 0);
            LogEvent("INFO", "HVR_GIT_INFO", HVR.VersionInfo.GIT_INFO, 0);

            if (HvrPlayerInterface.Initialise())
            {
                LogEvent("INFO", "HVR_PLAYERINTERFACE_GIT_VERSION", HvrPlayerInterface.GetInfo(HvrPlayerInterfaceAPI.Player_GetInfo_Keys.VERSION), 0);
                LogEvent("INFO", "HVR_PLAYERINTERFACE_GIT_INFO", HvrPlayerInterface.GetInfo(HvrPlayerInterfaceAPI.Player_GetInfo_Keys.GIT_INFO), 0);
            }

            LogEvent("INFO", "APPLICATION_UNITY_VERSION", Application.unityVersion, 0);
            LogEvent("INFO", "APPLICATION_PLATFORM", Application.platform.ToString(), 0);
            LogEvent("INFO", "SYSTEMINFO_OPERATINGSYSTEM", SystemInfo.operatingSystem, 0);
            LogEvent("INFO", "SYSTEMINFO_PROCESSORTYPE", SystemInfo.processorType, 0);
            LogEvent("INFO", "SYSTEMINFO_GRAPHICSDEVICENAME", SystemInfo.graphicsDeviceName.ToString(), 0);
            LogEvent("INFO", "SYSTEMINFO_GRAPHICSDEVICETYPE", SystemInfo.graphicsDeviceType.ToString(), 0);
        }
Exemplo n.º 4
0
        private void DrawAboutSection()
        {
            Rect links = EditorGUILayout.GetControlRect();

            GUI.Box(new Rect(links.x - 4, links.y, links.width + 8, links.height), "Links", EditorStyles.toolbarButton);

            GUILayout.BeginHorizontal();
            {
                GUILayout.FlexibleSpace();

                // Website
                if (GUILayout.Button("8i.com", GUILayout.Height(32), GUILayout.Width(100)))
                {
                    Application.OpenURL("http://8i.com");
                }

                // Website
                if (GUILayout.Button("Documentation", GUILayout.Height(32), GUILayout.Width(100)))
                {
                    Application.OpenURL("https://8i.com/unity/docs/index.html");
                }

                // Website
                if (GUILayout.Button("Support", GUILayout.Height(32), GUILayout.Width(100)))
                {
                    Application.OpenURL("https://8isupport.zendesk.com");
                }

                GUILayout.FlexibleSpace();
            }
            GUILayout.EndHorizontal();

            Rect baseRect = EditorGUILayout.GetControlRect();

            GUI.Box(new Rect(baseRect.x - 4, baseRect.y, baseRect.width + 8, baseRect.height), "Version Info", EditorStyles.toolbarButton);

            if (GUI.Button(new Rect(baseRect.xMax - 120, baseRect.y, 120, baseRect.height), "Copy To Clipboard", EditorStyles.miniButton))
            {
                EditorGUIUtility.systemCopyBuffer = about_info;
            }

            GUILayout.BeginVertical("box");
            {
                EditorGUILayout.TextArea(about_info, EditorStyles.largeLabel);
            }
            GUILayout.EndVertical();

            Rect memoryRect = EditorGUILayout.GetControlRect();

            GUI.Box(new Rect(memoryRect.x - 4, memoryRect.y, memoryRect.width + 8, memoryRect.height), "Memory Statistics", EditorStyles.toolbarButton);

            if (HvrPlayerInterface.Initialise())
            {
                GUILayout.BeginHorizontal();
                {
                    CommonTypes.MemoryStats memoryStats = Interface.HvrPlayerInterfaceAPI.Interface_GetMemoryStats();

                    GUILayout.BeginVertical("box");
                    {
                        string stats = string.Empty;

                        stats += "allocBytes\n";
                        stats += "allocBlocks\n";
                        stats += "freeBytes\n";
                        stats += "freeBlocks\n";
                        stats += "usedBytes\n";
                        stats += "usedBlocks";

                        EditorGUILayout.TextArea(stats, EditorStyles.largeLabel);
                    }
                    GUILayout.EndVertical();

                    GUILayout.BeginVertical("box");
                    {
                        string stats = string.Empty;

                        stats += memoryStats.allocBytes + "\n";
                        stats += memoryStats.allocBlocks + "\n";
                        stats += memoryStats.freeBytes + "\n";
                        stats += memoryStats.freeBlocks + "\n";
                        stats += memoryStats.usedBytes + "\n";
                        stats += memoryStats.usedBlocks;

                        EditorGUILayout.TextArea(stats, EditorStyles.largeLabel);
                    }
                    GUILayout.EndVertical();
                }
                GUILayout.EndHorizontal();
            }

            Rect settingsRect = EditorGUILayout.GetControlRect();

            GUI.Box(new Rect(settingsRect.x - 4, settingsRect.y, settingsRect.width + 8, settingsRect.height), "Settings", EditorStyles.toolbarButton);

            bool analyticsOptOut = HVR.Editor.Analytics.AnalyticsManager.GetOptOut();

            analyticsOptOut = EditorGUILayout.Toggle("Opt-out of Analytics", analyticsOptOut);
            HVR.Editor.Analytics.AnalyticsManager.SetOptOut(analyticsOptOut);
        }