diff --git a/Assets/UniGLTF/Runtime/UniGLTF/UniGLTFVersion.cs b/Assets/UniGLTF/Runtime/UniGLTF/UniGLTFVersion.cs index 4869f1fb54..b4d46b54a7 100644 --- a/Assets/UniGLTF/Runtime/UniGLTF/UniGLTFVersion.cs +++ b/Assets/UniGLTF/Runtime/UniGLTF/UniGLTFVersion.cs @@ -3,9 +3,9 @@ namespace UniGLTF { public static partial class UniGLTFVersion { - public const int MAJOR = 0; - public const int MINOR = 81; + public const int MAJOR = 2; + public const int MINOR = 17; public const int PATCH = 0; - public const string VERSION = "0.81.0"; + public const string VERSION = "2.17.0"; } } diff --git a/Assets/VRM/Editor/Format/VRMVersionMenu.cs b/Assets/VRM/Editor/Format/VRMVersionMenu.cs index ca70b6cc65..2ab67a6325 100644 --- a/Assets/VRM/Editor/Format/VRMVersionMenu.cs +++ b/Assets/VRM/Editor/Format/VRMVersionMenu.cs @@ -12,6 +12,10 @@ namespace VRM /// /// v0.81.0: com.vrmc.unigltf to com.vrmc.gltf and same version with univrm. /// + /// Major = 2 + /// Minor = VRMVersion.MINOR - 64 + /// Patch = VRMVersion.PATCH + /// /// public class VRMVersionMenu : EditorWindow { @@ -178,6 +182,21 @@ 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 @@ -219,14 +238,24 @@ 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(vrmVersion); - UpdateUniGLTFVersion(vrmVersion); + UpdateUniGLTFVersion(m_uniGltfVersion, vrmVersion); AssetDatabase.Refresh(); - Debug.Log($"{vrmVersion}"); + Debug.Log($"{m_uniGltfVersion}, {vrmVersion}"); } else { @@ -240,13 +269,13 @@ void OnGUI() } } - void UpdateUniGLTFVersion((int, int, int) vrm) + void UpdateUniGLTFVersion((int, int, int) uniGltf, (int, int, int) vrm) { var utf8 = new UTF8Encoding(false); File.WriteAllText(UniGltfVersionPath, string.Format(UniGltfVersionTemplate, - vrm.Item1, - vrm.Item2, - vrm.Item3), utf8); + uniGltf.Item1, + uniGltf.Item2, + uniGltf.Item3), utf8); File.WriteAllText(UniGLTFPackage.Path, string.Format(UniGLTFPackage.Template, $"{vrm.Item1}.{vrm.Item2}.{vrm.Item3}",