コード例 #1
0
 private void OnEnable()
 {
     m_status            = Status.Passive;
     m_serverVersion     = VersionInfo.Invalid;
     m_currentVersion    = PackageUpdateHandler.FindCurrentVersion();
     m_sourceFilename    = string.Empty;
     m_downloadDirectory = Path.GetTempPath();
     m_downloadProgress  = 0.0f;
 }
コード例 #2
0
        private void InstallTarget()
        {
            // Double/triple verifying so that we don't install to a git
            // checkout of AGXUnity.
            if (!m_currentVersion.IsValid)
            {
                Debug.LogWarning("It's to possible to update AGXUnity to git checkout.");
                return;
            }

            m_status = Status.Installing;

            PackageUpdateHandler.Install(new FileInfo(Target));
        }
コード例 #3
0
        private void OnGUI()
        {
            AGXDynamicsForUnityLogoGUI();

            EditorGUILayout.LabelField(GUI.MakeLabel("Thank you for using AGX Dynamics for Unity!", true),
                                       InspectorEditor.Skin.LabelMiddleCenter);

            GUILayout.Space(6);

            var fieldColor = EditorGUIUtility.isProSkin ?
                             Color.white :
                             Color.black;
            var fieldErrorColor = Color.Lerp(Color.red,
                                             Color.black,
                                             0.25f);

            var versionInfo = PackageUpdateHandler.FindCurrentVersion();

            InspectorGUI.SelectableTextField(GUI.MakeLabel("Version"),
                                             (versionInfo.IsValid ?
                                              versionInfo.VersionString :
                                              "git checkout").Color(fieldColor),
                                             InspectorEditor.Skin.Label);

            string agxDynamicsVersion = s_agxInfo.Version;

            if (string.IsNullOrEmpty(agxDynamicsVersion))
            {
                agxDynamicsVersion = GUI.AddColorTag("Unknown",
                                                     fieldErrorColor);
            }
            else
            {
                agxDynamicsVersion = GUI.AddColorTag(agxDynamicsVersion,
                                                     fieldColor);
            }

            InspectorGUI.SelectableTextField(GUI.MakeLabel("AGX Dynamics version"),
                                             agxDynamicsVersion,
                                             InspectorEditor.Skin.Label);

            InspectorGUI.LicenseEndDateField(s_agxInfo);

            InspectorGUI.BrandSeparator(1, 8);

            GUILayout.Label(GUI.MakeLabel("Online Documentation", true), InspectorEditor.Skin.Label);

            using (new EditorGUILayout.HorizontalScope(GUILayout.Width(200))) {
                if (InspectorGUI.Link(GUI.MakeLabel("AGX Dynamics for Unity")))
                {
                    Application.OpenURL(TopMenu.AGXDynamicsForUnityManualURL);
                }
                GUILayout.Label(" - ", InspectorEditor.Skin.Label);
                if (InspectorGUI.Link(GUI.MakeLabel("Examples")))
                {
                    Application.OpenURL(TopMenu.AGXDynamicsForUnityExamplesURL);
                }
            }

            using (new EditorGUILayout.HorizontalScope(GUILayout.Width(200))) {
                if (InspectorGUI.Link(GUI.MakeLabel("AGX Dynamics user manual")))
                {
                    Application.OpenURL(TopMenu.AGXUserManualURL);
                }
                GUILayout.Label(" - ", InspectorEditor.Skin.Label);
                if (InspectorGUI.Link(GUI.MakeLabel("AGX Dynamics API Reference")))
                {
                    Application.OpenURL(TopMenu.AGXAPIReferenceURL);
                }
            }

            InspectorGUI.BrandSeparator(1, 8);

            GUILayout.Label("Support", EditorStyles.boldLabel);
            EditorGUILayout.SelectableLabel("Please refer to the information received when purchasing your license for support contact information.",
                                            InspectorEditor.Skin.LabelWordWrap);
        }
コード例 #4
0
ファイル: AboutWindow.cs プロジェクト: hanyeah/AGXUnity
        private void OnGUI()
        {
            GUILayout.BeginHorizontal(GUILayout.Width(570));
            GUILayout.Box(IconManager.GetAGXUnityLogo(),
                          GUI.Skin.customStyles[3],
                          GUILayout.Width(400),
                          GUILayout.Height(100));
            GUILayout.EndHorizontal();

            EditorGUILayout.LabelField("© " + System.DateTime.Now.Year + " Algoryx Simulation AB",
                                       InspectorEditor.Skin.LabelMiddleCenter);

            InspectorGUI.BrandSeparator(1, 6);

            EditorGUILayout.LabelField(GUI.MakeLabel("Thank you for using AGX Dynamics for Unity!", true),
                                       InspectorEditor.Skin.LabelMiddleCenter);

            GUILayout.Space(6);

            var fieldColor = EditorGUIUtility.isProSkin ?
                             Color.white :
                             Color.black;
            var fieldErrorColor = Color.Lerp(Color.red,
                                             Color.black,
                                             0.25f);
            var fieldOkColor = Color.Lerp(Color.green,
                                          Color.black,
                                          0.35f);
            var fieldWarningColor = Color.Lerp(Color.yellow,
                                               Color.black,
                                               0.45f);

            var versionInfo = PackageUpdateHandler.FindCurrentVersion();

            EditorGUILayout.LabelField(GUI.MakeLabel("Version"),
                                       GUI.MakeLabel(versionInfo.IsValid ? versionInfo.VersionString : "git checkout", fieldColor),
                                       InspectorEditor.Skin.Label);

            string agxDynamicsVersion = s_agxInfo.Version;

            if (string.IsNullOrEmpty(agxDynamicsVersion))
            {
                agxDynamicsVersion = GUI.AddColorTag("Unknown",
                                                     fieldErrorColor);
            }
            else
            {
                agxDynamicsVersion = GUI.AddColorTag(agxDynamicsVersion,
                                                     fieldColor);
            }
            EditorGUILayout.LabelField(GUI.MakeLabel("AGX Dynamics version"),
                                       GUI.MakeLabel(agxDynamicsVersion),
                                       InspectorEditor.Skin.Label);

            EditorGUILayout.LabelField(GUI.MakeLabel(s_agxInfo.LicenseExpired ?
                                                     "License expired" :
                                                     "License expires"),
                                       s_agxInfo.ValidEndDate ?
                                       GUI.MakeLabel(s_agxInfo.EndDate.ToString("yyyy-MM-dd") +
                                                     GUI.AddColorTag($" ({s_agxInfo.DiffString} {(s_agxInfo.LicenseExpired ? "ago" : "remaining")})",
                                                                     s_agxInfo.LicenseExpired ?
                                                                     fieldErrorColor :
                                                                     s_agxInfo.IsLicenseAboutToBeExpired(10) ?
                                                                     fieldWarningColor :
                                                                     fieldOkColor),
                                                     fieldColor) :
                                       GUI.MakeLabel("License not found", fieldErrorColor),
                                       InspectorEditor.Skin.Label);

            InspectorGUI.BrandSeparator(1, 8);

            GUILayout.Label(GUI.MakeLabel("Online Documentation", true), InspectorEditor.Skin.Label);

            using (new EditorGUILayout.HorizontalScope(GUILayout.Width(200))) {
                if (InspectorGUI.Link(GUI.MakeLabel("AGX Dynamics for Unity")))
                {
                    Application.OpenURL(TopMenu.AGXDynamicsForUnityManualURL);
                }
                GUILayout.Label(" - ", InspectorEditor.Skin.Label);
                if (InspectorGUI.Link(GUI.MakeLabel("Examples")))
                {
                    Application.OpenURL(TopMenu.AGXDynamicsForUnityExamplesURL);
                }
            }

            using (new EditorGUILayout.HorizontalScope(GUILayout.Width(200))) {
                if (InspectorGUI.Link(GUI.MakeLabel("AGX Dynamics user manual")))
                {
                    Application.OpenURL(TopMenu.AGXUserManualURL);
                }
                GUILayout.Label(" - ", InspectorEditor.Skin.Label);
                if (InspectorGUI.Link(GUI.MakeLabel("AGX Dynamics API Reference")))
                {
                    Application.OpenURL(TopMenu.AGXAPIReferenceURL);
                }
            }

            InspectorGUI.BrandSeparator(1, 8);

            GUILayout.Label("Support", EditorStyles.boldLabel);
            EditorGUILayout.SelectableLabel("Please refer to the information received when purchasing your license for support contact information.",
                                            InspectorEditor.Skin.LabelWordWrap);
        }