mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-03-27 12:54:56 -05:00
内部バージョンは維持 UniGLTF/UniGLTFVersion.cs
* gltf/asset/generator は据え置き
This commit is contained in:
parent
77fa1e2c5e
commit
7189cfeeb3
|
|
@ -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";
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
///
|
||||
/// </summary>
|
||||
public class VRMVersionMenu : EditorWindow
|
||||
{
|
||||
|
|
@ -178,6 +182,21 @@ namespace VRM
|
|||
[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 @@ namespace VRM
|
|||
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 @@ namespace VRM
|
|||
}
|
||||
}
|
||||
|
||||
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}",
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user