コード例 #1
0
        private void DrawSdkUpdateComponent()
        {
            if (_updateCheckerSdkResponse != null)
            {
                if (_updateCheckerSdkResponse.IsError)
                {
#if GOTOUDON_DEV
                    SimpleGUI.ErrorBox(_updateCheckerSdkResponse.IsError, "Failed to check for VRChat SDK update.");
#endif
                    return;
                }

                ReleaseInfo releaseInfo = _updateCheckerSdkResponse.ReleaseInfo;
                if (releaseInfo.Version == null)
                {
                    return;
                }
                string newestSdkVersion  = NormalizeVrChatSDKVersion(releaseInfo.Version);
                string currentSdkVersion = NormalizeVrChatSDKVersion(GotoUdonEditor.CurrentSDKVersion);

                // I give up, TODO: save version in own repository instead of using vrchat
                if (currentSdkVersion.EndsWith("05.06") && newestSdkVersion.EndsWith("05.12"))
                {
                    return;
                }
                if (releaseInfo.Version.StartsWith(GotoUdonEditor.ImplementedSDKVersion))
                {
                    return;
                }

                if (releaseInfo.UnityPackage != null &&
                    SimpleGUI.InfoBox(
                        VersionUtils.IsRightNewerThanLeft(currentSdkVersion, newestSdkVersion),
                        $"There is new VRChat UDON SDK version available: {releaseInfo.Version}!\n{releaseInfo.Name}\n{releaseInfo.Description}")
                    )
                {
                    GUILayout.BeginHorizontal();
                    // if (!_downloadingSdk)
                    //     SimpleGUI.ActionButton($"Update to {releaseInfo.Version}!", UpdateSdk);
                    SimpleGUI.ActionButton("Download manually.", () => Application.OpenURL(releaseInfo.UnityPackage.DownloadUrl));
                    GUILayout.EndHorizontal();
                }
            }
        }
コード例 #2
0
        private static VRCVersionStatus IsVRChatSdkOutdated()
        {
            string currentSdkVersion     = GotoUdonEditor.CurrentSDKVersion;
            string implementedSdkVersion = GotoUdonEditor.ImplementedSDKVersion;

            if (currentSdkVersion == implementedSdkVersion)
            {
                return(VRCVersionStatus.Same);
            }

            try
            {
                return(VersionUtils.IsRightNewerThanLeft(currentSdkVersion, implementedSdkVersion)
                    ? VRCVersionStatus.Outdated
                    : VRCVersionStatus.TooNew);
            }
            catch
            {
                return(VRCVersionStatus.Error);
            }
        }
コード例 #3
0
 // supports only simple versions like "v1.0.0"
 public bool IsNewerThan(string version)
 {
     return(VersionUtils.IsRightNewerThanLeft(version, Version));
 }