Skip to content

Commit

Permalink
Merge pull request #809 from ousttrue/version/0_69_0
Browse files Browse the repository at this point in the history
Version/0 69 0
  • Loading branch information
PoChang007 authored Mar 22, 2021
2 parents b6cc226 + 59fbfe0 commit b40c65d
Show file tree
Hide file tree
Showing 6 changed files with 69 additions and 40 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 @@ -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";
}
}
4 changes: 2 additions & 2 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.4.2",
"version": "2.5.0",
"displayName": "UniGLTF",
"description": "GLTF importer and exporter",
"unity": "2018.4",
Expand All @@ -11,6 +11,6 @@
"name": "VRM Consortium"
},
"dependencies": {
"com.vrmc.vrmshaders": "0.68.2"
"com.vrmc.vrmshaders": "0.69.0"
}
}
85 changes: 57 additions & 28 deletions Assets/VRM/Editor/Format/VRMVersionMenu.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,20 @@
using UnityEditor;
using UnityEngine;
using UniGLTF;
using System;

namespace VRM
{
/// <summary>
/// VersionDialog
///
/// UniGLTFVersion は、 VRMVersion から自動的に決まる。
///
/// Major = 2
/// Minor = VRMVersion.MINOR - 64
/// Patch = VRMVersion.PATCH
///
/// </summary>
public class VRMVersionMenu : EditorWindow
{
/// <summary>
Expand Down Expand Up @@ -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;
}

/// <summary>
Expand All @@ -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
{
Expand Down Expand Up @@ -228,7 +257,7 @@ static void ShowVersionDialog()
{
var window = ScriptableObject.CreateInstance<VRMVersionMenu>();
window.m_vrmVersion = VRMVersion.VERSION;
window.m_uniGltfVersion = UniGLTFVersion.VERSION;
// window.m_uniGltfVersion = UniGLTFVersion.VERSION;
window.ShowUtility();
}
}
Expand Down
6 changes: 3 additions & 3 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 = 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";
}
}
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.68.2",
"version": "0.69.0",
"displayName": "VRM",
"description": "VRM importer",
"unity": "2018.4",
Expand All @@ -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"
}
}
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.68.2",
"version": "0.69.0",
"displayName": "VRM Shaders",
"description": "VRM Shaders",
"unity": "2018.4",
Expand Down

0 comments on commit b40c65d

Please sign in to comment.