Skip to content

Commit

Permalink
Merge pull request #1157 from ousttrue/version/v0_81_0
Browse files Browse the repository at this point in the history
UniVRM-0.81.0
  • Loading branch information
PoChang007 authored Aug 19, 2021
2 parents f3624e7 + 8e51cef commit 77fa1e2
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 56 deletions.
6 changes: 3 additions & 3 deletions Assets/UniGLTF/Runtime/UniGLTF/UniGLTFVersion.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ namespace UniGLTF
{
public static partial class UniGLTFVersion
{
public const int MAJOR = 2;
public const int MINOR = 16;
public const int MAJOR = 0;
public const int MINOR = 81;
public const int PATCH = 0;
public const string VERSION = "2.16.0";
public const string VERSION = "0.81.0";
}
}
6 changes: 3 additions & 3 deletions Assets/UniGLTF/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "com.vrmc.unigltf",
"version": "2.16.0",
"name": "com.vrmc.gltf",
"version": "0.81.0",
"displayName": "UniGLTF",
"description": "GLTF importer and exporter",
"unity": "2019.4",
Expand All @@ -11,6 +11,6 @@
"name": "VRM Consortium"
},
"dependencies": {
"com.vrmc.vrmshaders": "0.80.0"
"com.vrmc.vrmshaders": "0.81.0"
}
}
53 changes: 12 additions & 41 deletions Assets/VRM/Editor/Format/VRMVersionMenu.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,7 @@ namespace VRM
/// <summary>
/// VersionDialog
///
/// UniGLTFVersion は、 VRMVersion から自動的に決まる。
///
/// Major = 2
/// Minor = VRMVersion.MINOR - 64
/// Patch = VRMVersion.PATCH
/// v0.81.0: com.vrmc.unigltf to com.vrmc.gltf and same version with univrm.
///
/// </summary>
public class VRMVersionMenu : EditorWindow
Expand Down Expand Up @@ -163,7 +159,7 @@ public UpmPackage(string path, string template)

UpmPackage UniGLTFPackage = new UpmPackage("Assets/UniGLTF/package.json",
@"{{
""name"": ""com.vrmc.unigltf"",
""name"": ""com.vrmc.gltf"",
""version"": ""{0}"",
""displayName"": ""UniGLTF"",
""description"": ""GLTF importer and exporter"",
Expand All @@ -182,21 +178,6 @@ public UpmPackage(string path, string template)
[SerializeField]
string m_vrmVersion;

(int, int, int) m_uniGltfVersion
{
get
{
if (TryGetVersion(m_vrmVersion, out (int, int, int) vrmVersion))
{
return (2, vrmVersion.Item2 - 64, vrmVersion.Item3);
}
else
{
return (0, 0, 0);
}
}
}

static bool TryGetVersion(string src, out (int, int, int) version)
{
try
Expand Down Expand Up @@ -238,24 +219,14 @@ void OnGUI()
m_vrmVersion = EditorGUILayout.TextField("Major.Minor.Patch", m_vrmVersion);
GUILayout.Space(30);

GUILayout.Label("UniGLTF");
GUILayout.Label($"Current version: {UniGLTFVersion.VERSION}");
{
var enabled = GUI.enabled;
GUI.enabled = false;
EditorGUILayout.TextField("Major.Minor.Patch", $"{m_uniGltfVersion}");
GUI.enabled = enabled;
}
GUILayout.Space(30);

if (GUILayout.Button("Apply"))
{
if (TryGetVersion(m_vrmVersion, out (int, int, int) vrmVersion))
{
UpdateVrmVersion(m_uniGltfVersion, vrmVersion);
UpdateUniGLTFVersion(m_uniGltfVersion, vrmVersion);
UpdateVrmVersion(vrmVersion);
UpdateUniGLTFVersion(vrmVersion);
AssetDatabase.Refresh();
Debug.Log($"{m_uniGltfVersion}, {vrmVersion}");
Debug.Log($"{vrmVersion}");
}
else
{
Expand All @@ -269,21 +240,21 @@ void OnGUI()
}
}

void UpdateUniGLTFVersion((int, int, int) uniGltf, (int, int, int) vrm)
void UpdateUniGLTFVersion((int, int, int) vrm)
{
var utf8 = new UTF8Encoding(false);
File.WriteAllText(UniGltfVersionPath, string.Format(UniGltfVersionTemplate,
uniGltf.Item1,
uniGltf.Item2,
uniGltf.Item3), utf8);
vrm.Item1,
vrm.Item2,
vrm.Item3), utf8);

File.WriteAllText(UniGLTFPackage.Path, string.Format(UniGLTFPackage.Template,
$"{uniGltf.Item1}.{uniGltf.Item2}.{uniGltf.Item3}",
$"{vrm.Item1}.{vrm.Item2}.{vrm.Item3}",
$"{vrm.Item1}.{vrm.Item2}.{vrm.Item3}"
), utf8);
}

void UpdateVrmVersion((int, int, int) uniGltf, (int, int, int) vrm)
void UpdateVrmVersion((int, int, int) vrm)
{
// generate
var utf8 = new UTF8Encoding(false);
Expand All @@ -295,7 +266,7 @@ void UpdateVrmVersion((int, int, int) uniGltf, (int, int, int) vrm)
foreach (var upm in Packages)
{
File.WriteAllText(upm.Path, string.Format(upm.Template,
$"{uniGltf.Item1}.{uniGltf.Item2}.{uniGltf.Item3}",
$"{vrm.Item1}.{vrm.Item2}.{vrm.Item3}",
$"{vrm.Item1}.{vrm.Item2}.{vrm.Item3}"
), utf8);
}
Expand Down
4 changes: 2 additions & 2 deletions Assets/VRM/Runtime/Format/VRMVersion.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ namespace VRM
public static partial class VRMVersion
{
public const int MAJOR = 0;
public const int MINOR = 80;
public const int MINOR = 81;
public const int PATCH = 0;
public const string VERSION = "0.80.0";
public const string VERSION = "0.81.0";
}
}
6 changes: 3 additions & 3 deletions Assets/VRM/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "com.vrmc.univrm",
"version": "0.80.0",
"version": "0.81.0",
"displayName": "VRM",
"description": "VRM importer",
"unity": "2019.4",
Expand All @@ -14,8 +14,8 @@
"name": "VRM Consortium"
},
"dependencies": {
"com.vrmc.vrmshaders": "0.80.0",
"com.vrmc.unigltf": "2.16.0"
"com.vrmc.vrmshaders": "0.81.0",
"com.vrmc.unigltf": "0.81.0"
},
"samples": [
{
Expand Down
6 changes: 3 additions & 3 deletions Assets/VRM10/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "com.vrmc.vrm",
"version": "0.80.0",
"version": "0.81.0",
"displayName": "VRM-1.0β",
"description": "VRM-1.0β importer",
"unity": "2019.4",
Expand All @@ -14,8 +14,8 @@
"name": "VRM Consortium"
},
"dependencies": {
"com.vrmc.vrmshaders": "0.80.0",
"com.vrmc.unigltf": "2.16.0"
"com.vrmc.vrmshaders": "0.81.0",
"com.vrmc.unigltf": "0.81.0"
},
"samples": [
{
Expand Down
2 changes: 1 addition & 1 deletion Assets/VRMShaders/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "com.vrmc.vrmshaders",
"version": "0.80.0",
"version": "0.81.0",
"displayName": "VRM Shaders",
"description": "VRM Shaders",
"unity": "2019.4",
Expand Down

0 comments on commit 77fa1e2

Please sign in to comment.