diff --git a/Scripts/Format/Editor/VRMVersionMenu.cs b/Scripts/Format/Editor/VRMVersionMenu.cs index f6f778644..ed794222e 100644 --- a/Scripts/Format/Editor/VRMVersionMenu.cs +++ b/Scripts/Format/Editor/VRMVersionMenu.cs @@ -10,7 +10,7 @@ namespace VRM const string template = @" namespace VRM {{ - public static class VRMVersion + public static partial class VRMVersion {{ public const int MAJOR = {0}; public const int MINOR = {1}; diff --git a/Scripts/Format/VRMVersion.cs b/Scripts/Format/VRMVersion.cs index db5fea0e2..a72db0e3f 100644 --- a/Scripts/Format/VRMVersion.cs +++ b/Scripts/Format/VRMVersion.cs @@ -1,59 +1,14 @@ -using System; - namespace VRM { - public static class VRMVersion + public static partial class VRMVersion { public const int MAJOR = 0; - public const int MINOR = 36; + public const int MINOR = 37; - public const string VERSION = "0.36"; + public const string VERSION = "0.37"; - public const string DecrementMenuName = "VRM/Version(0.36) Decrement"; - public const string IncrementMenuName = "VRM/Version(0.36) Increment"; - - public static bool IsNewer(string version) - { - if (string.IsNullOrEmpty(version)) - { - return false; - } - - var prefix = "UniVRM-"; - if (version.StartsWith(prefix)) - { - version = version.Substring(prefix.Length); - } - - var splited = version.Split('.'); - if (splited.Length < 2) - { - return false; - } - - try - { - var major = int.Parse(splited[0]); - var minor = int.Parse(splited[1]); - - if (major < MAJOR) - { - return false; - } - else if (major > MAJOR) - { - return true; - } - else - { - return minor > MINOR; - } - } - catch (Exception) - { - return false; - } - } + public const string DecrementMenuName = "VRM/Version(0.37) Decrement"; + public const string IncrementMenuName = "VRM/Version(0.37) Increment"; } } diff --git a/Scripts/Format/VRMVersionPartial.cs b/Scripts/Format/VRMVersionPartial.cs new file mode 100644 index 000000000..623d3df01 --- /dev/null +++ b/Scripts/Format/VRMVersionPartial.cs @@ -0,0 +1,51 @@ + +using System; + +namespace VRM +{ + public static partial class VRMVersion + { + public static bool IsNewer(string version) + { + if (string.IsNullOrEmpty(version)) + { + return false; + } + + var prefix = "UniVRM-"; + if (version.StartsWith(prefix)) + { + version = version.Substring(prefix.Length); + } + + var splited = version.Split('.'); + if (splited.Length < 2) + { + return false; + } + + try + { + var major = int.Parse(splited[0]); + var minor = int.Parse(splited[1]); + + if (major < MAJOR) + { + return false; + } + else if (major > MAJOR) + { + return true; + } + else + { + return minor > MINOR; + } + } + catch (Exception) + { + return false; + } + } + } +} diff --git a/Scripts/Format/VRMVersionPartial.cs.meta b/Scripts/Format/VRMVersionPartial.cs.meta new file mode 100644 index 000000000..b505fdb09 --- /dev/null +++ b/Scripts/Format/VRMVersionPartial.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 4ab9ac9856a4d4c4aa652c07c5b496e6 +timeCreated: 1522130257 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: