IncrementVersion

This commit is contained in:
ousttrue 2018-05-25 16:44:42 +09:00
parent 553dd75e50
commit 689fbe3ca9
4 changed files with 70 additions and 51 deletions

View File

@ -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};

View File

@ -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";
}
}

View File

@ -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;
}
}
}
}

View File

@ -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: