public static void Init(string version, string summary)
        {
            newVersion = version;
            CognitiveVR_UpdateSDKWindow window = (CognitiveVR_UpdateSDKWindow)EditorWindow.GetWindow(typeof(CognitiveVR_UpdateSDKWindow), true, "cognitiveVR Update");

            window.sdkSummary = summary;
            window.Show();
        }
예제 #2
0
        static void UpdateCheckForUpdates()
        {
            if (!checkForUpdatesRequest.isDone)
            {
                //check for timeout
            }
            else
            {
                if (!string.IsNullOrEmpty(checkForUpdatesRequest.error))
                {
                    Debug.Log("Check for cognitiveVR SDK version update error: " + checkForUpdatesRequest.error);
                }

                if (!string.IsNullOrEmpty(checkForUpdatesRequest.downloadHandler.text))
                {
                    var info = JsonUtility.FromJson <ReleaseInfo>(checkForUpdatesRequest.downloadHandler.text);

                    var    version = info.tag_name;
                    string summary = info.body;

                    if (!string.IsNullOrEmpty(version))
                    {
                        if (version != CognitiveVR.Core.SDK_VERSION)
                        {
                            //new version
                            CognitiveVR_UpdateSDKWindow.Init(version, summary);
                        }
                        else if (EditorPrefs.GetString("cvr_skipVersion") == version)
                        {
                            //skip this version. limit this check to once a day
                            EditorPrefs.SetString("cvr_updateRemindDate", System.DateTime.UtcNow.AddDays(1).ToString(System.Globalization.CultureInfo.InvariantCulture));
                        }
                        else
                        {
                            //up to date
                            Debug.Log("Version " + version + ". You are up to date");
                        }
                    }
                }
                EditorApplication.update -= UpdateCheckForUpdates;
            }
        }