From 352b3bc2f60037c927ddf7b56ad9f518fb7dfd87 Mon Sep 17 00:00:00 2001 From: ousttrue Date: Mon, 22 Mar 2021 12:28:24 +0900 Subject: [PATCH 1/2] =?UTF-8?q?UniGLTFVersion=20=E3=81=8C=E3=80=81=20VRMVe?= =?UTF-8?q?rsion=20=E3=81=8B=E3=82=89=E8=87=AA=E5=8B=95=E7=9A=84=E3=81=AB?= =?UTF-8?q?=E6=B1=BA=E3=81=BE=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/VRM/Editor/Format/VRMVersionMenu.cs | 85 +++++++++++++++------- 1 file changed, 57 insertions(+), 28 deletions(-) diff --git a/Assets/VRM/Editor/Format/VRMVersionMenu.cs b/Assets/VRM/Editor/Format/VRMVersionMenu.cs index a660ed0d6e..99b36469b0 100644 --- a/Assets/VRM/Editor/Format/VRMVersionMenu.cs +++ b/Assets/VRM/Editor/Format/VRMVersionMenu.cs @@ -3,9 +3,20 @@ using UnityEditor; using UnityEngine; using UniGLTF; +using System; namespace VRM { + /// + /// VersionDialog + /// + /// UniGLTFVersion は、 VRMVersion から自動的に決まる。 + /// + /// Major = 2 + /// Minor = VRMVersion.MINOR - 64 + /// Patch = VRMVersion.PATCH + /// + /// public class VRMVersionMenu : EditorWindow { /// @@ -120,30 +131,50 @@ public UpmPackage(string name, string path, string template) [SerializeField] string m_vrmVersion; - [SerializeField] - string m_uniGltfVersion; + (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) { - if (string.IsNullOrEmpty(src)) + try { - version = default; - return false; - } + if (string.IsNullOrEmpty(src)) + { + version = default; + return false; + } - var splitted = src.Split('.'); - if (splitted.Length != 3) + var splitted = src.Split('.'); + if (splitted.Length != 3) + { + version = default; + return false; + } + + version = ( + int.Parse(splitted[0]), + int.Parse(splitted[1]), + int.Parse(splitted[2]) + ); + return true; + } + catch (Exception) { version = default; return false; } - - version = ( - int.Parse(splitted[0]), - int.Parse(splitted[1]), - int.Parse(splitted[2]) - ); - return true; } /// @@ -158,24 +189,22 @@ void OnGUI() GUILayout.Label("UniGLTF"); GUILayout.Label($"Current version: {UniGLTFVersion.VERSION}"); - m_uniGltfVersion = EditorGUILayout.TextField("Major.Minor.Patch", m_uniGltfVersion); + { + 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)) { - if (TryGetVersion(m_uniGltfVersion, out (int, int, int) uniGltfVersion)) - { - UpdateVrmVersion(uniGltfVersion, vrmVersion); - UpdateUniGLTFVersion(uniGltfVersion, vrmVersion); - AssetDatabase.Refresh(); - Debug.Log($"{uniGltfVersion}, {vrmVersion}"); - } - else - { - Debug.LogWarning($"InvalidFormat: {m_uniGltfVersion}"); - } + UpdateVrmVersion(m_uniGltfVersion, vrmVersion); + UpdateUniGLTFVersion(m_uniGltfVersion, vrmVersion); + AssetDatabase.Refresh(); + Debug.Log($"{m_uniGltfVersion}, {vrmVersion}"); } else { @@ -228,7 +257,7 @@ static void ShowVersionDialog() { var window = ScriptableObject.CreateInstance(); window.m_vrmVersion = VRMVersion.VERSION; - window.m_uniGltfVersion = UniGLTFVersion.VERSION; + // window.m_uniGltfVersion = UniGLTFVersion.VERSION; window.ShowUtility(); } } From 59fbfe03b56aad523859c8198cba741c61b94374 Mon Sep 17 00:00:00 2001 From: ousttrue Date: Mon, 22 Mar 2021 12:30:59 +0900 Subject: [PATCH 2/2] UniVRM-0.69.0 --- Assets/UniGLTF/Runtime/UniGLTF/UniGLTFVersion.cs | 6 +++--- Assets/UniGLTF/package.json | 4 ++-- Assets/VRM/Runtime/Format/VRMVersion.cs | 6 +++--- Assets/VRM/package.json | 6 +++--- Assets/VRMShaders/package.json | 2 +- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Assets/UniGLTF/Runtime/UniGLTF/UniGLTFVersion.cs b/Assets/UniGLTF/Runtime/UniGLTF/UniGLTFVersion.cs index 4df14e4aaf..b2139ccfe6 100644 --- a/Assets/UniGLTF/Runtime/UniGLTF/UniGLTFVersion.cs +++ b/Assets/UniGLTF/Runtime/UniGLTF/UniGLTFVersion.cs @@ -4,8 +4,8 @@ namespace UniGLTF public static partial class UniGLTFVersion { public const int MAJOR = 2; - public const int MINOR = 4; - public const int PATCH = 2; - public const string VERSION = "2.4.2"; + public const int MINOR = 5; + public const int PATCH = 0; + public const string VERSION = "2.5.0"; } } diff --git a/Assets/UniGLTF/package.json b/Assets/UniGLTF/package.json index 0e2a84cbcf..1bd77253e6 100644 --- a/Assets/UniGLTF/package.json +++ b/Assets/UniGLTF/package.json @@ -1,6 +1,6 @@ { "name": "com.vrmc.unigltf", - "version": "2.4.2", + "version": "2.5.0", "displayName": "UniGLTF", "description": "GLTF importer and exporter", "unity": "2018.4", @@ -11,6 +11,6 @@ "name": "VRM Consortium" }, "dependencies": { - "com.vrmc.vrmshaders": "0.68.2" + "com.vrmc.vrmshaders": "0.69.0" } } \ No newline at end of file diff --git a/Assets/VRM/Runtime/Format/VRMVersion.cs b/Assets/VRM/Runtime/Format/VRMVersion.cs index 51b40aaf1c..4038466b3f 100644 --- a/Assets/VRM/Runtime/Format/VRMVersion.cs +++ b/Assets/VRM/Runtime/Format/VRMVersion.cs @@ -4,8 +4,8 @@ namespace VRM public static partial class VRMVersion { public const int MAJOR = 0; - public const int MINOR = 68; - public const int PATCH = 2; - public const string VERSION = "0.68.2"; + public const int MINOR = 69; + public const int PATCH = 0; + public const string VERSION = "0.69.0"; } } diff --git a/Assets/VRM/package.json b/Assets/VRM/package.json index 8144ed576a..e0e51fbf3a 100644 --- a/Assets/VRM/package.json +++ b/Assets/VRM/package.json @@ -1,6 +1,6 @@ { "name": "com.vrmc.univrm", - "version": "0.68.2", + "version": "0.69.0", "displayName": "VRM", "description": "VRM importer", "unity": "2018.4", @@ -14,7 +14,7 @@ "name": "VRM Consortium" }, "dependencies": { - "com.vrmc.vrmshaders": "0.68.2", - "com.vrmc.unigltf": "2.4.2" + "com.vrmc.vrmshaders": "0.69.0", + "com.vrmc.unigltf": "2.5.0" } } diff --git a/Assets/VRMShaders/package.json b/Assets/VRMShaders/package.json index a7452d77c1..ca76783594 100644 --- a/Assets/VRMShaders/package.json +++ b/Assets/VRMShaders/package.json @@ -1,6 +1,6 @@ { "name": "com.vrmc.vrmshaders", - "version": "0.68.2", + "version": "0.69.0", "displayName": "VRM Shaders", "description": "VRM Shaders", "unity": "2018.4",