From 996bc91c93b3532085df51ac5424f2f76f6cb08e Mon Sep 17 00:00:00 2001 From: Masataka SUMI Date: Wed, 7 Sep 2022 15:04:23 +0900 Subject: [PATCH 1/8] Rename CacheEnum to CachedEnum --- .../Runtime/UniGLTF/Util/CachedEnum.meta | 3 + .../UniGLTF/Util/CachedEnum/CachedEnum.cs | 46 +++++++++++++++ .../CachedEnum.cs.meta} | 0 .../UniGLTF/Util/CachedEnum/CachedEnumType.cs | 59 +++++++++++++++++++ .../Util/CachedEnum/CachedEnumType.cs.meta | 3 + Assets/UniGLTF/Tests/UniGLTF/CacheEnumTest.cs | 9 +-- .../Runtime/BlendShape/BlendShapeAvatar.cs | 2 +- .../VRM/Runtime/FirstPerson/VRMFirstPerson.cs | 2 +- .../Runtime/Format/glTF_VRM_FirstPerson.cs | 2 +- .../VRM/Runtime/Format/glTF_VRM_Humanoid.cs | 2 +- Assets/VRM/Runtime/Format/glTF_VRM_Meta.cs | 6 +- Assets/VRM/Runtime/IO/VRMImporterContext.cs | 4 +- 12 files changed, 122 insertions(+), 16 deletions(-) create mode 100644 Assets/UniGLTF/Runtime/UniGLTF/Util/CachedEnum.meta create mode 100644 Assets/UniGLTF/Runtime/UniGLTF/Util/CachedEnum/CachedEnum.cs rename Assets/UniGLTF/Runtime/UniGLTF/Util/{CacheEnum.cs.meta => CachedEnum/CachedEnum.cs.meta} (100%) create mode 100644 Assets/UniGLTF/Runtime/UniGLTF/Util/CachedEnum/CachedEnumType.cs create mode 100644 Assets/UniGLTF/Runtime/UniGLTF/Util/CachedEnum/CachedEnumType.cs.meta diff --git a/Assets/UniGLTF/Runtime/UniGLTF/Util/CachedEnum.meta b/Assets/UniGLTF/Runtime/UniGLTF/Util/CachedEnum.meta new file mode 100644 index 000000000..a178bfff3 --- /dev/null +++ b/Assets/UniGLTF/Runtime/UniGLTF/Util/CachedEnum.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: fa5415f8a69d46508e9e8fe6ff0ea820 +timeCreated: 1662528504 \ No newline at end of file diff --git a/Assets/UniGLTF/Runtime/UniGLTF/Util/CachedEnum/CachedEnum.cs b/Assets/UniGLTF/Runtime/UniGLTF/Util/CachedEnum/CachedEnum.cs new file mode 100644 index 000000000..7cad86e75 --- /dev/null +++ b/Assets/UniGLTF/Runtime/UniGLTF/Util/CachedEnum/CachedEnum.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections; + +namespace UniGLTF +{ + public static class CachedEnum + { + public static T Parse(string name, bool ignoreCase = false) where T : struct, Enum + { + if (ignoreCase) + { + return CachedEnumType.ParseIgnoreCase(name); + } + else + { + return CachedEnumType.Parse(name); + } + } + + public static T TryParseOrDefault(string name, bool ignoreCase = false, T defaultValue = default) + where T : struct, Enum + { + try + { + if (ignoreCase) + { + return CachedEnumType.ParseIgnoreCase(name); + } + else + { + return CachedEnumType.Parse(name); + } + } + catch + { + return defaultValue; + } + } + + public static T[] GetValues() where T : struct, Enum + { + return CachedEnumType.Values; + } + } +} + diff --git a/Assets/UniGLTF/Runtime/UniGLTF/Util/CacheEnum.cs.meta b/Assets/UniGLTF/Runtime/UniGLTF/Util/CachedEnum/CachedEnum.cs.meta similarity index 100% rename from Assets/UniGLTF/Runtime/UniGLTF/Util/CacheEnum.cs.meta rename to Assets/UniGLTF/Runtime/UniGLTF/Util/CachedEnum/CachedEnum.cs.meta diff --git a/Assets/UniGLTF/Runtime/UniGLTF/Util/CachedEnum/CachedEnumType.cs b/Assets/UniGLTF/Runtime/UniGLTF/Util/CachedEnum/CachedEnumType.cs new file mode 100644 index 000000000..e3983140d --- /dev/null +++ b/Assets/UniGLTF/Runtime/UniGLTF/Util/CachedEnum/CachedEnumType.cs @@ -0,0 +1,59 @@ +using System; +using System.Collections.Generic; + +namespace UniGLTF +{ + internal static class CachedEnumType where T : struct, Enum + { + private static Dictionary _values = new Dictionary(); + private static Dictionary _ignoreCaseValues = new Dictionary(StringComparer.OrdinalIgnoreCase); + private static T[] _allValues; + + public static T[] Values + { + get + { + if (_allValues == null) + { + _allValues = Enum.GetValues(typeof(T)) as T[]; + } + + return _allValues; + } + } + + public static T ParseIgnoreCase(string name) + { + if(_ignoreCaseValues.TryGetValue(name, out var value)) + { + return value; + } + else + { + T result; + value = Enum.TryParse(name, true, out result) + ? result + : throw new ArgumentException(nameof(result)); + _ignoreCaseValues.Add(name, value); + return value; + } + } + + public static T Parse(string name) + { + if(_values.TryGetValue(name, out var value)) + { + return value; + } + else + { + T result; + value = Enum.TryParse(name, false, out result) + ? result + : throw new ArgumentException(nameof(result)); + _values.Add(name, value); + return value; + } + } + } +} \ No newline at end of file diff --git a/Assets/UniGLTF/Runtime/UniGLTF/Util/CachedEnum/CachedEnumType.cs.meta b/Assets/UniGLTF/Runtime/UniGLTF/Util/CachedEnum/CachedEnumType.cs.meta new file mode 100644 index 000000000..3d3336cf6 --- /dev/null +++ b/Assets/UniGLTF/Runtime/UniGLTF/Util/CachedEnum/CachedEnumType.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 439fd6a452234eeca5105e5591e8f9aa +timeCreated: 1662528509 \ No newline at end of file diff --git a/Assets/UniGLTF/Tests/UniGLTF/CacheEnumTest.cs b/Assets/UniGLTF/Tests/UniGLTF/CacheEnumTest.cs index a1e3a2ac0..ccaba22b4 100644 --- a/Assets/UniGLTF/Tests/UniGLTF/CacheEnumTest.cs +++ b/Assets/UniGLTF/Tests/UniGLTF/CacheEnumTest.cs @@ -9,13 +9,8 @@ namespace UniGLTF [Test] public void CacheEnumTestSimplePasses() { - Assert.AreEqual(default(HumanBodyBones), CacheEnum.TryParseOrDefault("xxx")); - -#if UNITY_5_6_OR_NEWER - Assert.AreEqual(HumanBodyBones.UpperChest, CacheEnum.TryParseOrDefault("upperchest", true)); -#else - Assert.AreEqual(default(HumanBodyBones), CacheEnum.TryParseOrDefault("upperchest")); -#endif + Assert.AreEqual(default(HumanBodyBones), CachedEnum.TryParseOrDefault("xxx")); + Assert.AreEqual(HumanBodyBones.UpperChest, CachedEnum.TryParseOrDefault("upperchest", true)); } } } diff --git a/Assets/VRM/Runtime/BlendShape/BlendShapeAvatar.cs b/Assets/VRM/Runtime/BlendShape/BlendShapeAvatar.cs index a5a416569..00d1055a3 100644 --- a/Assets/VRM/Runtime/BlendShape/BlendShapeAvatar.cs +++ b/Assets/VRM/Runtime/BlendShape/BlendShapeAvatar.cs @@ -61,7 +61,7 @@ namespace VRM /// public void CreateDefaultPreset() { - var presets = CacheEnum.GetValues(); + var presets = CachedEnum.GetValues(); foreach (var preset in presets) { diff --git a/Assets/VRM/Runtime/FirstPerson/VRMFirstPerson.cs b/Assets/VRM/Runtime/FirstPerson/VRMFirstPerson.cs index 1b600df6b..61dfbd4dc 100644 --- a/Assets/VRM/Runtime/FirstPerson/VRMFirstPerson.cs +++ b/Assets/VRM/Runtime/FirstPerson/VRMFirstPerson.cs @@ -126,7 +126,7 @@ namespace VRM { if (x.mesh == index) { - return CacheEnum.TryParseOrDefault(x.firstPersonFlag, true); + return CachedEnum.TryParseOrDefault(x.firstPersonFlag, true); } } diff --git a/Assets/VRM/Runtime/Format/glTF_VRM_FirstPerson.cs b/Assets/VRM/Runtime/Format/glTF_VRM_FirstPerson.cs index f1ab7e968..4a65522ce 100644 --- a/Assets/VRM/Runtime/Format/glTF_VRM_FirstPerson.cs +++ b/Assets/VRM/Runtime/Format/glTF_VRM_FirstPerson.cs @@ -72,7 +72,7 @@ namespace VRM { get { - return CacheEnum.TryParseOrDefault(lookAtTypeName, true); + return CachedEnum.TryParseOrDefault(lookAtTypeName, true); } set { lookAtTypeName = value.ToString(); } } diff --git a/Assets/VRM/Runtime/Format/glTF_VRM_Humanoid.cs b/Assets/VRM/Runtime/Format/glTF_VRM_Humanoid.cs index 27e1051f7..ec0ee3c65 100644 --- a/Assets/VRM/Runtime/Format/glTF_VRM_Humanoid.cs +++ b/Assets/VRM/Runtime/Format/glTF_VRM_Humanoid.cs @@ -139,7 +139,7 @@ namespace VRM } get { - return CacheEnum.Parse(bone, true); + return CachedEnum.Parse(bone, true); } } diff --git a/Assets/VRM/Runtime/Format/glTF_VRM_Meta.cs b/Assets/VRM/Runtime/Format/glTF_VRM_Meta.cs index c1036ebc7..f8f6380ae 100644 --- a/Assets/VRM/Runtime/Format/glTF_VRM_Meta.cs +++ b/Assets/VRM/Runtime/Format/glTF_VRM_Meta.cs @@ -36,7 +36,7 @@ namespace VRM { static UssageLicense FromString(string src) { - return CacheEnum.TryParseOrDefault(src, true); + return CachedEnum.TryParseOrDefault(src, true); } [JsonSchema(Description = "Title of VRM model")] @@ -69,7 +69,7 @@ namespace VRM { get { - return CacheEnum.TryParseOrDefault(allowedUserName, true); + return CachedEnum.TryParseOrDefault(allowedUserName, true); } set { @@ -135,7 +135,7 @@ namespace VRM { get { - return CacheEnum.TryParseOrDefault(licenseName, true); + return CachedEnum.TryParseOrDefault(licenseName, true); } set { diff --git a/Assets/VRM/Runtime/IO/VRMImporterContext.cs b/Assets/VRM/Runtime/IO/VRMImporterContext.cs index f48a19309..f56edfdf6 100644 --- a/Assets/VRM/Runtime/IO/VRMImporterContext.cs +++ b/Assets/VRM/Runtime/IO/VRMImporterContext.cs @@ -147,12 +147,12 @@ namespace VRM if (group != null) { asset.BlendShapeName = groupName; - asset.Preset = CacheEnum.TryParseOrDefault(group.presetName, true); + asset.Preset = CachedEnum.TryParseOrDefault(group.presetName, true); asset.IsBinary = group.isBinary; if (asset.Preset == BlendShapePreset.Unknown) { // fallback - asset.Preset = CacheEnum.TryParseOrDefault(group.name, true); + asset.Preset = CachedEnum.TryParseOrDefault(group.name, true); } asset.Values = group.binds.Select(x => { From 613a783d1e5e695ba9fb205aed020f7938c6439a Mon Sep 17 00:00:00 2001 From: Masataka SUMI Date: Wed, 7 Sep 2022 15:16:41 +0900 Subject: [PATCH 2/8] Refactoring --- .../UniGLTF/Runtime/UniGLTF/Util/CacheEnum.cs | 100 ------------------ .../UniGLTF/Util/CachedEnum/CachedEnum.cs | 20 +--- .../UniGLTF/Util/CachedEnum/CachedEnumType.cs | 39 ++----- 3 files changed, 14 insertions(+), 145 deletions(-) delete mode 100644 Assets/UniGLTF/Runtime/UniGLTF/Util/CacheEnum.cs diff --git a/Assets/UniGLTF/Runtime/UniGLTF/Util/CacheEnum.cs b/Assets/UniGLTF/Runtime/UniGLTF/Util/CacheEnum.cs deleted file mode 100644 index 5c90f6282..000000000 --- a/Assets/UniGLTF/Runtime/UniGLTF/Util/CacheEnum.cs +++ /dev/null @@ -1,100 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; - -namespace UniGLTF -{ - public sealed class CacheEnum - { - public static T Parse(string name, bool ignoreCase = false) where T : struct, Enum - { - if(ignoreCase) - { - return CacheParse.ParseIgnoreCase(name); - } - else - { - return CacheParse.Parse(name); - } - } - - public static T TryParseOrDefault(string name, bool ignoreCase = false, T defaultValue=default(T)) where T : struct, Enum - { - try - { - if(ignoreCase) - { - return CacheParse.ParseIgnoreCase(name); - } - else - { - return CacheParse.Parse(name); - } - } - catch - { - return defaultValue; - } - } - - public static T[] GetValues() where T : struct, Enum - { - return CacheValues.Values; - } - - private static class CacheParse where T : struct, Enum - { - private static Dictionary _values = new Dictionary(); - private static Dictionary _ignoreCaseValues = new Dictionary(StringComparer.OrdinalIgnoreCase); - - static CacheParse() - { - } - - public static T ParseIgnoreCase(string name) - { - if(_ignoreCaseValues.TryGetValue(name, out var value)) - { - return value; - } - else - { - T result; - value = Enum.TryParse(name, true, out result) - ? result - : throw new ArgumentException(nameof(result)); - _ignoreCaseValues.Add(name, value); - return value; - } - } - - public static T Parse(string name) - { - if(_values.TryGetValue(name, out var value)) - { - return value; - } - else - { - T result; - value = Enum.TryParse(name, false, out result) - ? result - : throw new ArgumentException(nameof(result)); - _values.Add(name, value); - return value; - } - } - } - - private static class CacheValues where T : struct, Enum - { - public static readonly T[] Values; - - static CacheValues() - { - Values = Enum.GetValues(typeof(T)) as T[]; - } - } - } -} - diff --git a/Assets/UniGLTF/Runtime/UniGLTF/Util/CachedEnum/CachedEnum.cs b/Assets/UniGLTF/Runtime/UniGLTF/Util/CachedEnum/CachedEnum.cs index 7cad86e75..702350931 100644 --- a/Assets/UniGLTF/Runtime/UniGLTF/Util/CachedEnum/CachedEnum.cs +++ b/Assets/UniGLTF/Runtime/UniGLTF/Util/CachedEnum/CachedEnum.cs @@ -1,5 +1,5 @@ using System; -using System.Collections; +using System.Collections.Generic; namespace UniGLTF { @@ -7,14 +7,7 @@ namespace UniGLTF { public static T Parse(string name, bool ignoreCase = false) where T : struct, Enum { - if (ignoreCase) - { - return CachedEnumType.ParseIgnoreCase(name); - } - else - { - return CachedEnumType.Parse(name); - } + return CachedEnumType.Parse(name, ignoreCase); } public static T TryParseOrDefault(string name, bool ignoreCase = false, T defaultValue = default) @@ -22,14 +15,7 @@ namespace UniGLTF { try { - if (ignoreCase) - { - return CachedEnumType.ParseIgnoreCase(name); - } - else - { - return CachedEnumType.Parse(name); - } + return Parse(name, ignoreCase: ignoreCase); } catch { diff --git a/Assets/UniGLTF/Runtime/UniGLTF/Util/CachedEnum/CachedEnumType.cs b/Assets/UniGLTF/Runtime/UniGLTF/Util/CachedEnum/CachedEnumType.cs index e3983140d..51b59d0ea 100644 --- a/Assets/UniGLTF/Runtime/UniGLTF/Util/CachedEnum/CachedEnumType.cs +++ b/Assets/UniGLTF/Runtime/UniGLTF/Util/CachedEnum/CachedEnumType.cs @@ -5,8 +5,8 @@ namespace UniGLTF { internal static class CachedEnumType where T : struct, Enum { - private static Dictionary _values = new Dictionary(); - private static Dictionary _ignoreCaseValues = new Dictionary(StringComparer.OrdinalIgnoreCase); + private static readonly Dictionary _values = new Dictionary(); + private static readonly Dictionary _ignoreCaseValues = new Dictionary(StringComparer.OrdinalIgnoreCase); private static T[] _allValues; public static T[] Values @@ -22,38 +22,21 @@ namespace UniGLTF } } - public static T ParseIgnoreCase(string name) + public static T Parse(string name, bool ignoreCase) { - if(_ignoreCaseValues.TryGetValue(name, out var value)) + var caches = ignoreCase ? _ignoreCaseValues : _values; + if (caches.TryGetValue(name, out var ignoreCaseValue)) { - return value; + return ignoreCaseValue; } - else - { - T result; - value = Enum.TryParse(name, true, out result) - ? result - : throw new ArgumentException(nameof(result)); - _ignoreCaseValues.Add(name, value); - return value; - } - } - public static T Parse(string name) - { - if(_values.TryGetValue(name, out var value)) + if (Enum.TryParse(name, ignoreCase, out var result)) { - return value; - } - else - { - T result; - value = Enum.TryParse(name, false, out result) - ? result - : throw new ArgumentException(nameof(result)); - _values.Add(name, value); - return value; + _values.Add(name, result); + return result; } + + throw new ArgumentException(name); } } } \ No newline at end of file From 85a3f0fe3a67905a4e4ad6cbd13ff3db9d9e2c89 Mon Sep 17 00:00:00 2001 From: Masataka SUMI Date: Wed, 7 Sep 2022 15:20:06 +0900 Subject: [PATCH 3/8] fix --- .../UniGLTF/Runtime/UniGLTF/Util/CachedEnum/CachedEnumType.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Assets/UniGLTF/Runtime/UniGLTF/Util/CachedEnum/CachedEnumType.cs b/Assets/UniGLTF/Runtime/UniGLTF/Util/CachedEnum/CachedEnumType.cs index 51b59d0ea..c41e983fe 100644 --- a/Assets/UniGLTF/Runtime/UniGLTF/Util/CachedEnum/CachedEnumType.cs +++ b/Assets/UniGLTF/Runtime/UniGLTF/Util/CachedEnum/CachedEnumType.cs @@ -25,6 +25,7 @@ namespace UniGLTF public static T Parse(string name, bool ignoreCase) { var caches = ignoreCase ? _ignoreCaseValues : _values; + if (caches.TryGetValue(name, out var ignoreCaseValue)) { return ignoreCaseValue; @@ -32,7 +33,7 @@ namespace UniGLTF if (Enum.TryParse(name, ignoreCase, out var result)) { - _values.Add(name, result); + caches.Add(name, result); return result; } From 29163a43b191111ca11d1adb4e6a167425b9d2ae Mon Sep 17 00:00:00 2001 From: Masataka SUMI Date: Wed, 7 Sep 2022 15:38:02 +0900 Subject: [PATCH 4/8] Use CachedEnum --- .../UniGLTF/Editor/UniGLTF/ExportDialog/InternalTPose.cs | 2 +- Assets/UniGLTF/Editor/UniGLTF/ExportDialog/M17N.cs | 6 +++--- Assets/UniGLTF/Editor/UniGLTF/Gizmo/BoneInfo.cs | 2 +- Assets/VRM/Editor/Format/VRMEditorExporter.cs | 3 +-- Assets/VRM/Runtime/IO/VRMExporter.cs | 2 +- .../VRM/Runtime/SkinnedMeshUtility/VRMBoneNormalizer.cs | 4 ++-- .../Expression/ReorderableMaterialColorBindingList.cs | 3 ++- Assets/VRM10/Editor/Vrm10InstanceEditor.cs | 2 +- Assets/VRM10/Runtime/IO/Model/ModelExporter.cs | 2 +- Assets/VRM10/vrmlib/Runtime/Humanoid/Humanoid.cs | 3 ++- Assets/VRM10/vrmlib/Runtime/Model.cs | 8 ++++---- Assets/VRM10_Samples/VRM10Viewer/VRM10ViewerUI.cs | 2 +- 12 files changed, 20 insertions(+), 19 deletions(-) diff --git a/Assets/UniGLTF/Editor/UniGLTF/ExportDialog/InternalTPose.cs b/Assets/UniGLTF/Editor/UniGLTF/ExportDialog/InternalTPose.cs index 703068203..7d6d1e294 100644 --- a/Assets/UniGLTF/Editor/UniGLTF/ExportDialog/InternalTPose.cs +++ b/Assets/UniGLTF/Editor/UniGLTF/ExportDialog/InternalTPose.cs @@ -149,7 +149,7 @@ namespace UniGLTF var existingMappings = new Dictionary(); var animator = go.GetComponent(); - foreach (HumanBodyBones bone in Enum.GetValues(typeof(HumanBodyBones))) + foreach (var bone in CachedEnum.GetValues()) { if (bone == HumanBodyBones.LastBone) { diff --git a/Assets/UniGLTF/Editor/UniGLTF/ExportDialog/M17N.cs b/Assets/UniGLTF/Editor/UniGLTF/ExportDialog/M17N.cs index 69e8c2fb7..3f2c00c4c 100644 --- a/Assets/UniGLTF/Editor/UniGLTF/ExportDialog/M17N.cs +++ b/Assets/UniGLTF/Editor/UniGLTF/ExportDialog/M17N.cs @@ -28,7 +28,7 @@ namespace UniGLTF.M17N } } - public static class MsgCache where T : Enum + public static class MsgCache where T : struct, Enum { static Dictionary> s_cache = new Dictionary>(); @@ -57,7 +57,7 @@ namespace UniGLTF.M17N map = new Dictionary(); var t = typeof(T); - foreach (T value in Enum.GetValues(t)) + foreach (T value in CachedEnum.GetValues()) { var match = GetAttribute(value, language); // Attribute。無かったら enum の ToString @@ -107,7 +107,7 @@ namespace UniGLTF.M17N } } - public static string Msg(this T key) where T : Enum + public static string Msg(this T key) where T : struct, Enum { return MsgCache.Get(Lang, key); } diff --git a/Assets/UniGLTF/Editor/UniGLTF/Gizmo/BoneInfo.cs b/Assets/UniGLTF/Editor/UniGLTF/Gizmo/BoneInfo.cs index 09cb3a798..c6d5f9817 100644 --- a/Assets/UniGLTF/Editor/UniGLTF/Gizmo/BoneInfo.cs +++ b/Assets/UniGLTF/Editor/UniGLTF/Gizmo/BoneInfo.cs @@ -129,7 +129,7 @@ namespace UniGLTF throw new ArgumentException("not humanoid"); } - var validBones = ((HumanBodyBones[])Enum.GetValues(typeof(HumanBodyBones))) + var validBones = CachedEnum.GetValues() .Where(x => x != HumanBodyBones.LastBone) .ToArray(); var headSelectedBones = new HashSet(); diff --git a/Assets/VRM/Editor/Format/VRMEditorExporter.cs b/Assets/VRM/Editor/Format/VRMEditorExporter.cs index 4c2755d82..a15205344 100644 --- a/Assets/VRM/Editor/Format/VRMEditorExporter.cs +++ b/Assets/VRM/Editor/Format/VRMEditorExporter.cs @@ -171,8 +171,7 @@ namespace VRM // copy先 var afterTransforms = target.GetComponentsInChildren(); // copy先のhumanoidBoneのリストを得る - var bones = (HumanBodyBones[])Enum.GetValues(typeof(HumanBodyBones)); - var humanTransforms = bones + var humanTransforms = CachedEnum.GetValues() .Where(x => x != HumanBodyBones.LastBone) .Select(x => animator.GetBoneTransform(x)) .Where(x => x != null) diff --git a/Assets/VRM/Runtime/IO/VRMExporter.cs b/Assets/VRM/Runtime/IO/VRMExporter.cs index 1b5c06422..72e463bae 100644 --- a/Assets/VRM/Runtime/IO/VRMExporter.cs +++ b/Assets/VRM/Runtime/IO/VRMExporter.cs @@ -72,7 +72,7 @@ namespace VRM { // set humanoid bone mapping var avatar = animator.avatar; - foreach (HumanBodyBones key in Enum.GetValues(typeof(HumanBodyBones))) + foreach (HumanBodyBones key in CachedEnum.GetValues()) { if (key == HumanBodyBones.LastBone) { diff --git a/Assets/VRM/Runtime/SkinnedMeshUtility/VRMBoneNormalizer.cs b/Assets/VRM/Runtime/SkinnedMeshUtility/VRMBoneNormalizer.cs index 8d9154692..24742bcbe 100644 --- a/Assets/VRM/Runtime/SkinnedMeshUtility/VRMBoneNormalizer.cs +++ b/Assets/VRM/Runtime/SkinnedMeshUtility/VRMBoneNormalizer.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Linq; +using UniGLTF; using UniGLTF.MeshUtility; using UniHumanoid; using UnityEngine; @@ -71,8 +72,7 @@ namespace VRM { var src = _src.GetComponent(); - var srcHumanBones = Enum.GetValues(typeof(HumanBodyBones)) - .Cast() + var srcHumanBones = CachedEnum.GetValues() .Where(x => x != HumanBodyBones.LastBone) .Select(x => new { Key = x, Value = src.GetBoneTransform(x) }) .Where(x => x.Value != null) diff --git a/Assets/VRM10/Editor/Components/Expression/ReorderableMaterialColorBindingList.cs b/Assets/VRM10/Editor/Components/Expression/ReorderableMaterialColorBindingList.cs index 2a190975e..0baaf81bd 100644 --- a/Assets/VRM10/Editor/Components/Expression/ReorderableMaterialColorBindingList.cs +++ b/Assets/VRM10/Editor/Components/Expression/ReorderableMaterialColorBindingList.cs @@ -1,4 +1,5 @@ using System; +using UniGLTF; using UnityEditor; using UnityEditorInternal; using UnityEngine; @@ -52,7 +53,7 @@ namespace UniVRM10 // 対象のプロパティを enum から選択する var bindTypeProp = property.FindPropertyRelative("BindType"); - var bindTypes = (UniGLTF.Extensions.VRMC_vrm.MaterialColorType[])Enum.GetValues(typeof(UniGLTF.Extensions.VRMC_vrm.MaterialColorType)); + var bindTypes = CachedEnum.GetValues(); var bindType = bindTypes[bindTypeProp.enumValueIndex]; var newBindType = ExpressionEditorHelper.EnumPopup(rect, bindType); if (newBindType != bindType) diff --git a/Assets/VRM10/Editor/Vrm10InstanceEditor.cs b/Assets/VRM10/Editor/Vrm10InstanceEditor.cs index e51dc38dc..35aa561d6 100644 --- a/Assets/VRM10/Editor/Vrm10InstanceEditor.cs +++ b/Assets/VRM10/Editor/Vrm10InstanceEditor.cs @@ -136,7 +136,7 @@ namespace UniVRM10 if (!string.IsNullOrEmpty(dir)) { var expressions = new Dictionary(); - foreach (ExpressionPreset expression in System.Enum.GetValues(typeof(ExpressionPreset))) + foreach (ExpressionPreset expression in CachedEnum.GetValues()) { if (expression == ExpressionPreset.custom) { diff --git a/Assets/VRM10/Runtime/IO/Model/ModelExporter.cs b/Assets/VRM10/Runtime/IO/Model/ModelExporter.cs index 899537002..a1ad13ecb 100644 --- a/Assets/VRM10/Runtime/IO/Model/ModelExporter.cs +++ b/Assets/VRM10/Runtime/IO/Model/ModelExporter.cs @@ -40,7 +40,7 @@ namespace UniVRM10 humanoid.AssignBonesFromAnimator(); } - foreach (HumanBodyBones humanBoneType in Enum.GetValues(typeof(HumanBodyBones))) + foreach (HumanBodyBones humanBoneType in CachedEnum.GetValues()) { var transform = humanoid.GetBoneTransform(humanBoneType); if (transform != null && Nodes.TryGetValue(transform.gameObject, out VrmLib.Node node)) diff --git a/Assets/VRM10/vrmlib/Runtime/Humanoid/Humanoid.cs b/Assets/VRM10/vrmlib/Runtime/Humanoid/Humanoid.cs index 8f21319be..5dc1c349d 100644 --- a/Assets/VRM10/vrmlib/Runtime/Humanoid/Humanoid.cs +++ b/Assets/VRM10/vrmlib/Runtime/Humanoid/Humanoid.cs @@ -2,6 +2,7 @@ using System; using System.Linq; using System.Collections; using System.Collections.Generic; +using UniGLTF; using UnityEngine; @@ -457,7 +458,7 @@ namespace VrmLib public void Clear() { - foreach (HumanoidBones key in Enum.GetValues(typeof(HumanoidBones))) + foreach (HumanoidBones key in CachedEnum.GetValues()) { Add(key, null); } diff --git a/Assets/VRM10/vrmlib/Runtime/Model.cs b/Assets/VRM10/vrmlib/Runtime/Model.cs index 0cb16a501..eca169da1 100644 --- a/Assets/VRM10/vrmlib/Runtime/Model.cs +++ b/Assets/VRM10/vrmlib/Runtime/Model.cs @@ -115,10 +115,10 @@ namespace VrmLib // HumanoidBonesでBoneRequiredAttributeが定義されているものすべてが使われているかどうかを判断 var boneattributes - = Enum.GetValues(typeof(HumanoidBones)).Cast() - .Select(bone => bone.GetType().GetField(bone.ToString())) - .Select(info => info.GetCustomAttributes(typeof(BoneRequiredAttribute), false) as BoneRequiredAttribute[]) - .Where(attributes => attributes.Length > 0); + = CachedEnum.GetValues() + .Select(bone => bone.GetType().GetField(bone.ToString())) + .Select(info => info.GetCustomAttributes(typeof(BoneRequiredAttribute), false) as BoneRequiredAttribute[]) + .Where(attributes => attributes.Length > 0); var nodeHumanoids = vrmhumanoids diff --git a/Assets/VRM10_Samples/VRM10Viewer/VRM10ViewerUI.cs b/Assets/VRM10_Samples/VRM10Viewer/VRM10ViewerUI.cs index d29896e85..62ede917f 100644 --- a/Assets/VRM10_Samples/VRM10Viewer/VRM10ViewerUI.cs +++ b/Assets/VRM10_Samples/VRM10Viewer/VRM10ViewerUI.cs @@ -276,7 +276,7 @@ namespace UniVRM10.VRM10Viewer { var controlRig = m_controller.Runtime.ControlRig; - foreach (HumanBodyBones bone in Enum.GetValues(typeof(HumanBodyBones))) + foreach (HumanBodyBones bone in CachedEnum.GetValues()) { if (bone == HumanBodyBones.LastBone) { From 894ba1ececb410d01375a5c4ab724e8066b874ee Mon Sep 17 00:00:00 2001 From: Masataka SUMI Date: Wed, 7 Sep 2022 15:42:41 +0900 Subject: [PATCH 5/8] Use CachedEnum instead of EnumUtil --- Assets/VRM10/Runtime/IO/Vrm10ImportData.cs | 4 +- Assets/VRM10/Runtime/IO/Vrm10Importer.cs | 2 +- Assets/VRM10/vrmlib/Runtime/EnumUtil.cs | 59 -------------------- Assets/VRM10/vrmlib/Runtime/EnumUtil.cs.meta | 11 ---- 4 files changed, 3 insertions(+), 73 deletions(-) delete mode 100644 Assets/VRM10/vrmlib/Runtime/EnumUtil.cs delete mode 100644 Assets/VRM10/vrmlib/Runtime/EnumUtil.cs.meta diff --git a/Assets/VRM10/Runtime/IO/Vrm10ImportData.cs b/Assets/VRM10/Runtime/IO/Vrm10ImportData.cs index c829ffadc..37c5bd1f6 100644 --- a/Assets/VRM10/Runtime/IO/Vrm10ImportData.cs +++ b/Assets/VRM10/Runtime/IO/Vrm10ImportData.cs @@ -202,7 +202,7 @@ namespace UniVRM10 } var accessor = Gltf.accessors[accessorIndex]; var bytes = GetAccessorBytes(accessorIndex); - var vectorType = EnumUtil.Parse(accessor.type); + var vectorType = CachedEnum.Parse(accessor.type, ignoreCase: true); ba = new BufferAccessor(m_data.NativeArrayManager, bytes, (AccessorValueType)accessor.componentType, vectorType, accessor.count); return true; @@ -278,7 +278,7 @@ namespace UniVRM10 var bytes = bin.GetSubArray(start, totalCount * firstAccessor.GetStride()); return new BufferAccessor(m_data.NativeArrayManager, bytes, (AccessorValueType)firstAccessor.componentType, - EnumUtil.Parse(firstAccessor.type), + CachedEnum.Parse(firstAccessor.type, ignoreCase: true), totalCount); } else diff --git a/Assets/VRM10/Runtime/IO/Vrm10Importer.cs b/Assets/VRM10/Runtime/IO/Vrm10Importer.cs index 265b3c2ff..bb70f4f2f 100644 --- a/Assets/VRM10/Runtime/IO/Vrm10Importer.cs +++ b/Assets/VRM10/Runtime/IO/Vrm10Importer.cs @@ -721,7 +721,7 @@ namespace UniVRM10 case VrmLib.HumanoidBones.rightThumbMetacarpal: return HumanBodyBones.RightThumbProximal; case VrmLib.HumanoidBones.rightThumbProximal: return HumanBodyBones.RightThumbIntermediate; } - return VrmLib.EnumUtil.Cast(bone); + return CachedEnum.Parse(bone.ToString(), ignoreCase: true); } /// diff --git a/Assets/VRM10/vrmlib/Runtime/EnumUtil.cs b/Assets/VRM10/vrmlib/Runtime/EnumUtil.cs deleted file mode 100644 index 46447797e..000000000 --- a/Assets/VRM10/vrmlib/Runtime/EnumUtil.cs +++ /dev/null @@ -1,59 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; - -namespace VrmLib -{ - public static class EnumUtil - { - public static T Parse(string src, bool ignoreCase = true) where T : struct - { - if (string.IsNullOrEmpty(src)) - { - return default(T); - } - - return (T)Enum.Parse(typeof(T), src, ignoreCase); - } - - public static T TryParseOrDefault(string src, T defaultValue = default(T)) where T : struct - { - try - { - return (T)Enum.Parse(typeof(T), src, true); - } - catch (Exception) - { - return defaultValue; - } - } - - public static T Cast(object src, bool ignoreCase = true) where T : struct - { - if (src is null) - { - throw new ArgumentNullException(); - } - - return (T)Enum.Parse(typeof(T), src.ToString(), ignoreCase); - } - - class GenericCache where T : Enum - { - public static T[] Values = GetValues().ToArray(); - - static IEnumerable GetValues() - { - foreach (var t in Enum.GetValues(typeof(T))) - { - yield return (T)t; - } - } - } - - public static T[] Values() where T : Enum - { - return GenericCache.Values; - } - } -} diff --git a/Assets/VRM10/vrmlib/Runtime/EnumUtil.cs.meta b/Assets/VRM10/vrmlib/Runtime/EnumUtil.cs.meta deleted file mode 100644 index 28808c47e..000000000 --- a/Assets/VRM10/vrmlib/Runtime/EnumUtil.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 035afec0107099641b5bc89b84a51733 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: From 8b9491e5a9d198d46e1ed63d7374653f88f5b103 Mon Sep 17 00:00:00 2001 From: Masataka SUMI Date: Wed, 7 Sep 2022 15:46:51 +0900 Subject: [PATCH 6/8] mv --- Assets/UniGLTF/Runtime/UniGLTF/Util/CachedEnum.meta | 3 --- Assets/UniGLTF/Runtime/{UniGLTF/Util.meta => Utils.meta} | 2 +- Assets/UniGLTF/Runtime/Utils/CachedEnum.meta | 8 ++++++++ .../{UniGLTF/Util => Utils}/CachedEnum/CachedEnum.cs | 0 .../{UniGLTF/Util => Utils}/CachedEnum/CachedEnum.cs.meta | 0 .../{UniGLTF/Util => Utils}/CachedEnum/CachedEnumType.cs | 0 .../Util => Utils}/CachedEnum/CachedEnumType.cs.meta | 0 .../Runtime/{UniGLTF/Util => Utils}/TransformState.cs | 0 .../{UniGLTF/Util => Utils}/TransformState.cs.meta | 4 ++-- 9 files changed, 11 insertions(+), 6 deletions(-) delete mode 100644 Assets/UniGLTF/Runtime/UniGLTF/Util/CachedEnum.meta rename Assets/UniGLTF/Runtime/{UniGLTF/Util.meta => Utils.meta} (77%) create mode 100644 Assets/UniGLTF/Runtime/Utils/CachedEnum.meta rename Assets/UniGLTF/Runtime/{UniGLTF/Util => Utils}/CachedEnum/CachedEnum.cs (100%) rename Assets/UniGLTF/Runtime/{UniGLTF/Util => Utils}/CachedEnum/CachedEnum.cs.meta (100%) rename Assets/UniGLTF/Runtime/{UniGLTF/Util => Utils}/CachedEnum/CachedEnumType.cs (100%) rename Assets/UniGLTF/Runtime/{UniGLTF/Util => Utils}/CachedEnum/CachedEnumType.cs.meta (100%) rename Assets/UniGLTF/Runtime/{UniGLTF/Util => Utils}/TransformState.cs (100%) rename Assets/UniGLTF/Runtime/{UniGLTF/Util => Utils}/TransformState.cs.meta (71%) diff --git a/Assets/UniGLTF/Runtime/UniGLTF/Util/CachedEnum.meta b/Assets/UniGLTF/Runtime/UniGLTF/Util/CachedEnum.meta deleted file mode 100644 index a178bfff3..000000000 --- a/Assets/UniGLTF/Runtime/UniGLTF/Util/CachedEnum.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: fa5415f8a69d46508e9e8fe6ff0ea820 -timeCreated: 1662528504 \ No newline at end of file diff --git a/Assets/UniGLTF/Runtime/UniGLTF/Util.meta b/Assets/UniGLTF/Runtime/Utils.meta similarity index 77% rename from Assets/UniGLTF/Runtime/UniGLTF/Util.meta rename to Assets/UniGLTF/Runtime/Utils.meta index 84a19a442..db945a3ee 100644 --- a/Assets/UniGLTF/Runtime/UniGLTF/Util.meta +++ b/Assets/UniGLTF/Runtime/Utils.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 1595b81f792ed7b469e4391dcc7d335f +guid: b6b7c2110b314bf4cbe36f2e16bb44a8 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Assets/UniGLTF/Runtime/Utils/CachedEnum.meta b/Assets/UniGLTF/Runtime/Utils/CachedEnum.meta new file mode 100644 index 000000000..45099b92f --- /dev/null +++ b/Assets/UniGLTF/Runtime/Utils/CachedEnum.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: bca6484928e42dc46a2d05b11bbc2d75 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/UniGLTF/Runtime/UniGLTF/Util/CachedEnum/CachedEnum.cs b/Assets/UniGLTF/Runtime/Utils/CachedEnum/CachedEnum.cs similarity index 100% rename from Assets/UniGLTF/Runtime/UniGLTF/Util/CachedEnum/CachedEnum.cs rename to Assets/UniGLTF/Runtime/Utils/CachedEnum/CachedEnum.cs diff --git a/Assets/UniGLTF/Runtime/UniGLTF/Util/CachedEnum/CachedEnum.cs.meta b/Assets/UniGLTF/Runtime/Utils/CachedEnum/CachedEnum.cs.meta similarity index 100% rename from Assets/UniGLTF/Runtime/UniGLTF/Util/CachedEnum/CachedEnum.cs.meta rename to Assets/UniGLTF/Runtime/Utils/CachedEnum/CachedEnum.cs.meta diff --git a/Assets/UniGLTF/Runtime/UniGLTF/Util/CachedEnum/CachedEnumType.cs b/Assets/UniGLTF/Runtime/Utils/CachedEnum/CachedEnumType.cs similarity index 100% rename from Assets/UniGLTF/Runtime/UniGLTF/Util/CachedEnum/CachedEnumType.cs rename to Assets/UniGLTF/Runtime/Utils/CachedEnum/CachedEnumType.cs diff --git a/Assets/UniGLTF/Runtime/UniGLTF/Util/CachedEnum/CachedEnumType.cs.meta b/Assets/UniGLTF/Runtime/Utils/CachedEnum/CachedEnumType.cs.meta similarity index 100% rename from Assets/UniGLTF/Runtime/UniGLTF/Util/CachedEnum/CachedEnumType.cs.meta rename to Assets/UniGLTF/Runtime/Utils/CachedEnum/CachedEnumType.cs.meta diff --git a/Assets/UniGLTF/Runtime/UniGLTF/Util/TransformState.cs b/Assets/UniGLTF/Runtime/Utils/TransformState.cs similarity index 100% rename from Assets/UniGLTF/Runtime/UniGLTF/Util/TransformState.cs rename to Assets/UniGLTF/Runtime/Utils/TransformState.cs diff --git a/Assets/UniGLTF/Runtime/UniGLTF/Util/TransformState.cs.meta b/Assets/UniGLTF/Runtime/Utils/TransformState.cs.meta similarity index 71% rename from Assets/UniGLTF/Runtime/UniGLTF/Util/TransformState.cs.meta rename to Assets/UniGLTF/Runtime/Utils/TransformState.cs.meta index f32750195..29ef11d81 100644 --- a/Assets/UniGLTF/Runtime/UniGLTF/Util/TransformState.cs.meta +++ b/Assets/UniGLTF/Runtime/Utils/TransformState.cs.meta @@ -1,3 +1,3 @@ -fileFormatVersion: 2 -guid: 172d698f753e4e59bf65a75014016221 +fileFormatVersion: 2 +guid: 172d698f753e4e59bf65a75014016221 timeCreated: 1657022395 \ No newline at end of file From b9861308174ccec956cd639a1a0f6b91e07d7410 Mon Sep 17 00:00:00 2001 From: Masataka SUMI Date: Wed, 7 Sep 2022 15:53:59 +0900 Subject: [PATCH 7/8] Create an asmdef named UniGLTF.Utils --- Assets/UniGLTF/Editor/UniGLTF.Editor.asmdef | 4 +++- Assets/UniGLTF/Runtime/UniGLTF.asmdef | 4 +++- Assets/UniGLTF/Runtime/UniHumanoid/BoneMapping.cs | 3 ++- Assets/UniGLTF/Runtime/UniHumanoid/Humanoid.cs | 3 ++- .../Runtime/UniHumanoid/SkeletonMeshUtility.cs | 1 - .../UniGLTF/Runtime/UniHumanoid/UniHumanoid.asmdef | 5 ++++- Assets/UniGLTF/Runtime/Utils/UniGLTF.Utils.asmdef | 14 ++++++++++++++ .../Runtime/Utils/UniGLTF.Utils.asmdef.meta | 7 +++++++ Assets/UniGLTF/Tests/UniGLTF.Tests.asmdef | 4 +++- Assets/VRM/Editor/VRM.Editor.asmdef | 3 ++- Assets/VRM/Runtime/VRM.asmdef | 4 +++- Assets/VRM10/Editor/VRM10.Editor.asmdef | 4 +++- Assets/VRM10/Runtime/VRM10.asmdef | 4 +++- Assets/VRM10/vrmlib/Runtime/VrmLib.asmdef | 4 +++- .../VRM10Viewer/VRM10.Samples.VRM10Viewer.asmdef | 4 +++- .../SimpleViewer/VRM.Samples.SimpleViewer.asmdef | 1 + 16 files changed, 56 insertions(+), 13 deletions(-) create mode 100644 Assets/UniGLTF/Runtime/Utils/UniGLTF.Utils.asmdef create mode 100644 Assets/UniGLTF/Runtime/Utils/UniGLTF.Utils.asmdef.meta diff --git a/Assets/UniGLTF/Editor/UniGLTF.Editor.asmdef b/Assets/UniGLTF/Editor/UniGLTF.Editor.asmdef index 7d8718ed4..8298fa473 100644 --- a/Assets/UniGLTF/Editor/UniGLTF.Editor.asmdef +++ b/Assets/UniGLTF/Editor/UniGLTF.Editor.asmdef @@ -1,9 +1,11 @@ { "name": "UniGLTF.Editor", + "rootNamespace": "", "references": [ "GUID:8d76e605759c3f64a957d63ef96ada7c", "GUID:da3e51d19d51a544fa14d43fee843098", - "GUID:7da8a75dcade2144aab699032d7d7987" + "GUID:7da8a75dcade2144aab699032d7d7987", + "GUID:1cd941934d098654fa21a13f28346412" ], "includePlatforms": [ "Editor" diff --git a/Assets/UniGLTF/Runtime/UniGLTF.asmdef b/Assets/UniGLTF/Runtime/UniGLTF.asmdef index 7932fb6b1..b0a6d0090 100644 --- a/Assets/UniGLTF/Runtime/UniGLTF.asmdef +++ b/Assets/UniGLTF/Runtime/UniGLTF.asmdef @@ -1,8 +1,10 @@ { "name": "UniGLTF", + "rootNamespace": "", "references": [ "GUID:da3e51d19d51a544fa14d43fee843098", - "GUID:60c8346e00a8ddd4cafc5a02eceeec57" + "GUID:60c8346e00a8ddd4cafc5a02eceeec57", + "GUID:1cd941934d098654fa21a13f28346412" ], "includePlatforms": [], "excludePlatforms": [], diff --git a/Assets/UniGLTF/Runtime/UniHumanoid/BoneMapping.cs b/Assets/UniGLTF/Runtime/UniHumanoid/BoneMapping.cs index f9233e664..132b40968 100644 --- a/Assets/UniGLTF/Runtime/UniHumanoid/BoneMapping.cs +++ b/Assets/UniGLTF/Runtime/UniHumanoid/BoneMapping.cs @@ -1,6 +1,7 @@ using UnityEngine; using System.Linq; using System; +using UniGLTF; namespace UniHumanoid { @@ -26,7 +27,7 @@ namespace UniHumanoid { if (animator.avatar != null) { - foreach (HumanBodyBones key in Enum.GetValues(typeof(HumanBodyBones))) + foreach (var key in CachedEnum.GetValues()) { if (key == HumanBodyBones.LastBone) { diff --git a/Assets/UniGLTF/Runtime/UniHumanoid/Humanoid.cs b/Assets/UniGLTF/Runtime/UniHumanoid/Humanoid.cs index 2b099488e..e12466e88 100644 --- a/Assets/UniGLTF/Runtime/UniHumanoid/Humanoid.cs +++ b/Assets/UniGLTF/Runtime/UniHumanoid/Humanoid.cs @@ -2,6 +2,7 @@ using System.Collections; using System.Collections.Generic; using System.Linq; +using UniGLTF; using UnityEngine; namespace UniHumanoid @@ -424,7 +425,7 @@ namespace UniHumanoid return false; } - var keys = (UnityEngine.HumanBodyBones[])Enum.GetValues(typeof(UnityEngine.HumanBodyBones)); + var keys = CachedEnum.GetValues(); AssignBones(keys.Select(x => { diff --git a/Assets/UniGLTF/Runtime/UniHumanoid/SkeletonMeshUtility.cs b/Assets/UniGLTF/Runtime/UniHumanoid/SkeletonMeshUtility.cs index 053a36dd1..3ad55a440 100644 --- a/Assets/UniGLTF/Runtime/UniHumanoid/SkeletonMeshUtility.cs +++ b/Assets/UniGLTF/Runtime/UniHumanoid/SkeletonMeshUtility.cs @@ -186,7 +186,6 @@ namespace UniHumanoid public static SkinnedMeshRenderer CreateRenderer(Animator animator) { - //var bodyBones = (HumanBodyBones[])Enum.GetValues(typeof(HumanBodyBones)); var bones = animator.transform.Traverse().ToList(); var builder = new MeshBuilder(); diff --git a/Assets/UniGLTF/Runtime/UniHumanoid/UniHumanoid.asmdef b/Assets/UniGLTF/Runtime/UniHumanoid/UniHumanoid.asmdef index b66a78290..825f3bbc2 100644 --- a/Assets/UniGLTF/Runtime/UniHumanoid/UniHumanoid.asmdef +++ b/Assets/UniGLTF/Runtime/UniHumanoid/UniHumanoid.asmdef @@ -1,6 +1,9 @@ { "name": "UniHumanoid", - "references": [], + "rootNamespace": "", + "references": [ + "GUID:1cd941934d098654fa21a13f28346412" + ], "includePlatforms": [], "excludePlatforms": [], "allowUnsafeCode": false, diff --git a/Assets/UniGLTF/Runtime/Utils/UniGLTF.Utils.asmdef b/Assets/UniGLTF/Runtime/Utils/UniGLTF.Utils.asmdef new file mode 100644 index 000000000..57d5bdce8 --- /dev/null +++ b/Assets/UniGLTF/Runtime/Utils/UniGLTF.Utils.asmdef @@ -0,0 +1,14 @@ +{ + "name": "UniGLTF.Utils", + "rootNamespace": "", + "references": [], + "includePlatforms": [], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": false, + "precompiledReferences": [], + "autoReferenced": false, + "defineConstraints": [], + "versionDefines": [], + "noEngineReferences": false +} \ No newline at end of file diff --git a/Assets/UniGLTF/Runtime/Utils/UniGLTF.Utils.asmdef.meta b/Assets/UniGLTF/Runtime/Utils/UniGLTF.Utils.asmdef.meta new file mode 100644 index 000000000..c62d0915a --- /dev/null +++ b/Assets/UniGLTF/Runtime/Utils/UniGLTF.Utils.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 1cd941934d098654fa21a13f28346412 +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/UniGLTF/Tests/UniGLTF.Tests.asmdef b/Assets/UniGLTF/Tests/UniGLTF.Tests.asmdef index e1ebdd170..bf3839155 100644 --- a/Assets/UniGLTF/Tests/UniGLTF.Tests.asmdef +++ b/Assets/UniGLTF/Tests/UniGLTF.Tests.asmdef @@ -1,12 +1,14 @@ { "name": "UniGLTF.Tests", + "rootNamespace": "", "references": [ "GUID:8d76e605759c3f64a957d63ef96ada7c", "GUID:5f875fdc81c40184c8333b9d63c6ddd5", "GUID:da3e51d19d51a544fa14d43fee843098", "GUID:7da8a75dcade2144aab699032d7d7987", "GUID:27619889b8ba8c24980f49ee34dbb44a", - "GUID:0acc523941302664db1f4e527237feb3" + "GUID:0acc523941302664db1f4e527237feb3", + "GUID:1cd941934d098654fa21a13f28346412" ], "includePlatforms": [ "Editor" diff --git a/Assets/VRM/Editor/VRM.Editor.asmdef b/Assets/VRM/Editor/VRM.Editor.asmdef index 88f69347e..1f917e647 100644 --- a/Assets/VRM/Editor/VRM.Editor.asmdef +++ b/Assets/VRM/Editor/VRM.Editor.asmdef @@ -1,5 +1,6 @@ { "name": "UniVRM.Editor", + "rootNamespace": "", "references": [ "GUID:05dd262a0c0a2f841b8252c8c3815582", "GUID:b7aa47b240b57de44a4b2021c143c9bf", @@ -8,7 +9,7 @@ "GUID:8d76e605759c3f64a957d63ef96ada7c", "GUID:5f875fdc81c40184c8333b9d63c6ddd5", "GUID:301b251fd9834274c9228e0532f444f7", - "GUID:bc66ece0f33b52446a0830c05781d4db" + "GUID:1cd941934d098654fa21a13f28346412" ], "includePlatforms": [ "Editor" diff --git a/Assets/VRM/Runtime/VRM.asmdef b/Assets/VRM/Runtime/VRM.asmdef index c89f8bc23..0a3337f3e 100644 --- a/Assets/VRM/Runtime/VRM.asmdef +++ b/Assets/VRM/Runtime/VRM.asmdef @@ -1,12 +1,14 @@ { "name": "VRM", + "rootNamespace": "", "references": [ "GUID:b7aa47b240b57de44a4b2021c143c9bf", "GUID:8d76e605759c3f64a957d63ef96ada7c", "GUID:da3e51d19d51a544fa14d43fee843098", "GUID:301b251fd9834274c9228e0532f444f7", "GUID:a9bc101fb0471f94a8f99fd242fdd934", - "GUID:ac229b552c3025545b074203f857547c" + "GUID:ac229b552c3025545b074203f857547c", + "GUID:1cd941934d098654fa21a13f28346412" ], "includePlatforms": [], "excludePlatforms": [], diff --git a/Assets/VRM10/Editor/VRM10.Editor.asmdef b/Assets/VRM10/Editor/VRM10.Editor.asmdef index 1e347d844..ad3c9fdc3 100644 --- a/Assets/VRM10/Editor/VRM10.Editor.asmdef +++ b/Assets/VRM10/Editor/VRM10.Editor.asmdef @@ -1,5 +1,6 @@ { "name": "VRM10.Editor", + "rootNamespace": "", "references": [ "GUID:e47c917724578cc43b5506c17a27e9a0", "GUID:2ef84b520212e174a94668c7a0862d3b", @@ -7,7 +8,8 @@ "GUID:8d76e605759c3f64a957d63ef96ada7c", "GUID:da3e51d19d51a544fa14d43fee843098", "GUID:7da8a75dcade2144aab699032d7d7987", - "GUID:b7aa47b240b57de44a4b2021c143c9bf" + "GUID:b7aa47b240b57de44a4b2021c143c9bf", + "GUID:1cd941934d098654fa21a13f28346412" ], "includePlatforms": [ "Editor" diff --git a/Assets/VRM10/Runtime/VRM10.asmdef b/Assets/VRM10/Runtime/VRM10.asmdef index e8a38f04c..9c5174d79 100644 --- a/Assets/VRM10/Runtime/VRM10.asmdef +++ b/Assets/VRM10/Runtime/VRM10.asmdef @@ -1,5 +1,6 @@ { "name": "VRM10", + "rootNamespace": "", "references": [ "GUID:2ef84b520212e174a94668c7a0862d3b", "GUID:a9bc101fb0471f94a8f99fd242fdd934", @@ -9,7 +10,8 @@ "GUID:0aaf403bd13871a44b7127aef2695ff8", "GUID:b7aa47b240b57de44a4b2021c143c9bf", "GUID:f2ca1407928ebdc4bbe7765cc278be44", - "GUID:2665a8d13d1b3f18800f46e256720795" + "GUID:2665a8d13d1b3f18800f46e256720795", + "GUID:1cd941934d098654fa21a13f28346412" ], "includePlatforms": [], "excludePlatforms": [], diff --git a/Assets/VRM10/vrmlib/Runtime/VrmLib.asmdef b/Assets/VRM10/vrmlib/Runtime/VrmLib.asmdef index 0e41a1f25..308107e1e 100644 --- a/Assets/VRM10/vrmlib/Runtime/VrmLib.asmdef +++ b/Assets/VRM10/vrmlib/Runtime/VrmLib.asmdef @@ -1,7 +1,9 @@ { "name": "VrmLib", + "rootNamespace": "", "references": [ - "GUID:8d76e605759c3f64a957d63ef96ada7c" + "GUID:8d76e605759c3f64a957d63ef96ada7c", + "GUID:1cd941934d098654fa21a13f28346412" ], "includePlatforms": [], "excludePlatforms": [], diff --git a/Assets/VRM10_Samples/VRM10Viewer/VRM10.Samples.VRM10Viewer.asmdef b/Assets/VRM10_Samples/VRM10Viewer/VRM10.Samples.VRM10Viewer.asmdef index 1082f824b..dc15df086 100644 --- a/Assets/VRM10_Samples/VRM10Viewer/VRM10.Samples.VRM10Viewer.asmdef +++ b/Assets/VRM10_Samples/VRM10Viewer/VRM10.Samples.VRM10Viewer.asmdef @@ -1,10 +1,12 @@ { "name": "VRM10.Samples.VRM10Viewer", + "rootNamespace": "", "references": [ "GUID:b7aa47b240b57de44a4b2021c143c9bf", "GUID:da3e51d19d51a544fa14d43fee843098", "GUID:8d76e605759c3f64a957d63ef96ada7c", - "GUID:e47c917724578cc43b5506c17a27e9a0" + "GUID:e47c917724578cc43b5506c17a27e9a0", + "GUID:1cd941934d098654fa21a13f28346412" ], "includePlatforms": [], "excludePlatforms": [], diff --git a/Assets/VRM_Samples/SimpleViewer/VRM.Samples.SimpleViewer.asmdef b/Assets/VRM_Samples/SimpleViewer/VRM.Samples.SimpleViewer.asmdef index 34e7e556d..6db561b0b 100644 --- a/Assets/VRM_Samples/SimpleViewer/VRM.Samples.SimpleViewer.asmdef +++ b/Assets/VRM_Samples/SimpleViewer/VRM.Samples.SimpleViewer.asmdef @@ -1,5 +1,6 @@ { "name": "VRM.Samples.SimpleViewer", + "rootNamespace": "", "references": [ "GUID:da3e51d19d51a544fa14d43fee843098", "GUID:b7aa47b240b57de44a4b2021c143c9bf", From 0dfa783406a4b4df720dced18dcaa7ad681386aa Mon Sep 17 00:00:00 2001 From: Masataka SUMI Date: Wed, 7 Sep 2022 15:59:35 +0900 Subject: [PATCH 8/8] mv CachedEnum namespace to UniGLTF.Utils --- Assets/UniGLTF/Editor/UniGLTF/ExportDialog/InternalTPose.cs | 1 + Assets/UniGLTF/Editor/UniGLTF/ExportDialog/M17N.cs | 1 + Assets/UniGLTF/Editor/UniGLTF/Gizmo/BoneInfo.cs | 1 + Assets/UniGLTF/Runtime/UniGLTF/RuntimeGltfInstance.cs | 2 +- Assets/UniGLTF/Runtime/UniHumanoid/BoneMapping.cs | 3 +-- Assets/UniGLTF/Runtime/UniHumanoid/Humanoid.cs | 3 +-- Assets/UniGLTF/Runtime/Utils/CachedEnum/CachedEnum.cs | 3 +-- Assets/UniGLTF/Runtime/Utils/CachedEnum/CachedEnumType.cs | 2 +- Assets/UniGLTF/Runtime/Utils/TransformState.cs | 2 +- Assets/UniGLTF/Tests/UniGLTF/CacheEnumTest.cs | 1 + Assets/VRM/Editor/Format/VRMEditorExporter.cs | 1 + Assets/VRM/Runtime/BlendShape/BlendShapeAvatar.cs | 1 + Assets/VRM/Runtime/FirstPerson/VRMFirstPerson.cs | 1 + Assets/VRM/Runtime/Format/glTF_VRM_FirstPerson.cs | 2 +- Assets/VRM/Runtime/Format/glTF_VRM_Humanoid.cs | 1 + Assets/VRM/Runtime/Format/glTF_VRM_Meta.cs | 2 +- Assets/VRM/Runtime/IO/VRMExporter.cs | 2 +- Assets/VRM/Runtime/IO/VRMImporterContext.cs | 2 +- Assets/VRM/Runtime/SkinnedMeshUtility/VRMBoneNormalizer.cs | 2 +- .../Expression/ReorderableMaterialColorBindingList.cs | 2 +- Assets/VRM10/Editor/Vrm10InstanceEditor.cs | 1 + Assets/VRM10/Runtime/Components/Vrm10Runtime/Vrm10Runtime.cs | 1 + Assets/VRM10/Runtime/IO/Model/ModelExporter.cs | 3 +-- Assets/VRM10/Runtime/IO/Vrm10ImportData.cs | 1 + Assets/VRM10/Runtime/IO/Vrm10Importer.cs | 1 + Assets/VRM10/vrmlib/Runtime/Humanoid/Humanoid.cs | 2 +- Assets/VRM10/vrmlib/Runtime/Model.cs | 1 + Assets/VRM10_Samples/VRM10Viewer/VRM10ViewerUI.cs | 1 + 28 files changed, 28 insertions(+), 18 deletions(-) diff --git a/Assets/UniGLTF/Editor/UniGLTF/ExportDialog/InternalTPose.cs b/Assets/UniGLTF/Editor/UniGLTF/ExportDialog/InternalTPose.cs index 7d6d1e294..3536ef1a1 100644 --- a/Assets/UniGLTF/Editor/UniGLTF/ExportDialog/InternalTPose.cs +++ b/Assets/UniGLTF/Editor/UniGLTF/ExportDialog/InternalTPose.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Linq; using System.Reflection; using UniGLTF.M17N; +using UniGLTF.Utils; using UnityEngine; namespace UniGLTF diff --git a/Assets/UniGLTF/Editor/UniGLTF/ExportDialog/M17N.cs b/Assets/UniGLTF/Editor/UniGLTF/ExportDialog/M17N.cs index 3f2c00c4c..aebb5d545 100644 --- a/Assets/UniGLTF/Editor/UniGLTF/ExportDialog/M17N.cs +++ b/Assets/UniGLTF/Editor/UniGLTF/ExportDialog/M17N.cs @@ -2,6 +2,7 @@ using System; using System.Collections.Generic; using System.Globalization; using System.Linq; +using UniGLTF.Utils; using UnityEditor; namespace UniGLTF.M17N diff --git a/Assets/UniGLTF/Editor/UniGLTF/Gizmo/BoneInfo.cs b/Assets/UniGLTF/Editor/UniGLTF/Gizmo/BoneInfo.cs index c6d5f9817..c29c62ff1 100644 --- a/Assets/UniGLTF/Editor/UniGLTF/Gizmo/BoneInfo.cs +++ b/Assets/UniGLTF/Editor/UniGLTF/Gizmo/BoneInfo.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Linq; +using UniGLTF.Utils; using UnityEngine; namespace UniGLTF diff --git a/Assets/UniGLTF/Runtime/UniGLTF/RuntimeGltfInstance.cs b/Assets/UniGLTF/Runtime/UniGLTF/RuntimeGltfInstance.cs index 09e8de3fe..57b9cefe2 100644 --- a/Assets/UniGLTF/Runtime/UniGLTF/RuntimeGltfInstance.cs +++ b/Assets/UniGLTF/Runtime/UniGLTF/RuntimeGltfInstance.cs @@ -1,5 +1,5 @@ using System.Collections.Generic; -using System.Linq; +using UniGLTF.Utils; using UnityEngine; using VRMShaders; diff --git a/Assets/UniGLTF/Runtime/UniHumanoid/BoneMapping.cs b/Assets/UniGLTF/Runtime/UniHumanoid/BoneMapping.cs index 132b40968..a3c9446ea 100644 --- a/Assets/UniGLTF/Runtime/UniHumanoid/BoneMapping.cs +++ b/Assets/UniGLTF/Runtime/UniHumanoid/BoneMapping.cs @@ -1,7 +1,6 @@ using UnityEngine; using System.Linq; -using System; -using UniGLTF; +using UniGLTF.Utils; namespace UniHumanoid { diff --git a/Assets/UniGLTF/Runtime/UniHumanoid/Humanoid.cs b/Assets/UniGLTF/Runtime/UniHumanoid/Humanoid.cs index e12466e88..247e020b7 100644 --- a/Assets/UniGLTF/Runtime/UniHumanoid/Humanoid.cs +++ b/Assets/UniGLTF/Runtime/UniHumanoid/Humanoid.cs @@ -1,8 +1,7 @@ using System; -using System.Collections; using System.Collections.Generic; using System.Linq; -using UniGLTF; +using UniGLTF.Utils; using UnityEngine; namespace UniHumanoid diff --git a/Assets/UniGLTF/Runtime/Utils/CachedEnum/CachedEnum.cs b/Assets/UniGLTF/Runtime/Utils/CachedEnum/CachedEnum.cs index 702350931..7bf4bd131 100644 --- a/Assets/UniGLTF/Runtime/Utils/CachedEnum/CachedEnum.cs +++ b/Assets/UniGLTF/Runtime/Utils/CachedEnum/CachedEnum.cs @@ -1,7 +1,6 @@ using System; -using System.Collections.Generic; -namespace UniGLTF +namespace UniGLTF.Utils { public static class CachedEnum { diff --git a/Assets/UniGLTF/Runtime/Utils/CachedEnum/CachedEnumType.cs b/Assets/UniGLTF/Runtime/Utils/CachedEnum/CachedEnumType.cs index c41e983fe..8133d2a8e 100644 --- a/Assets/UniGLTF/Runtime/Utils/CachedEnum/CachedEnumType.cs +++ b/Assets/UniGLTF/Runtime/Utils/CachedEnum/CachedEnumType.cs @@ -1,7 +1,7 @@ using System; using System.Collections.Generic; -namespace UniGLTF +namespace UniGLTF.Utils { internal static class CachedEnumType where T : struct, Enum { diff --git a/Assets/UniGLTF/Runtime/Utils/TransformState.cs b/Assets/UniGLTF/Runtime/Utils/TransformState.cs index 7e31b2f32..17b2d54f0 100644 --- a/Assets/UniGLTF/Runtime/Utils/TransformState.cs +++ b/Assets/UniGLTF/Runtime/Utils/TransformState.cs @@ -1,6 +1,6 @@ using UnityEngine; -namespace UniGLTF +namespace UniGLTF.Utils { public readonly struct TransformState { diff --git a/Assets/UniGLTF/Tests/UniGLTF/CacheEnumTest.cs b/Assets/UniGLTF/Tests/UniGLTF/CacheEnumTest.cs index ccaba22b4..e14ee7919 100644 --- a/Assets/UniGLTF/Tests/UniGLTF/CacheEnumTest.cs +++ b/Assets/UniGLTF/Tests/UniGLTF/CacheEnumTest.cs @@ -1,4 +1,5 @@ using NUnit.Framework; +using UniGLTF.Utils; using UnityEngine; diff --git a/Assets/VRM/Editor/Format/VRMEditorExporter.cs b/Assets/VRM/Editor/Format/VRMEditorExporter.cs index a15205344..b8fdce6fb 100644 --- a/Assets/VRM/Editor/Format/VRMEditorExporter.cs +++ b/Assets/VRM/Editor/Format/VRMEditorExporter.cs @@ -4,6 +4,7 @@ using System.Linq; using System.Text; using UniGLTF; using UniGLTF.MeshUtility; +using UniGLTF.Utils; using UnityEngine; using VRMShaders; diff --git a/Assets/VRM/Runtime/BlendShape/BlendShapeAvatar.cs b/Assets/VRM/Runtime/BlendShape/BlendShapeAvatar.cs index 00d1055a3..743ef2001 100644 --- a/Assets/VRM/Runtime/BlendShape/BlendShapeAvatar.cs +++ b/Assets/VRM/Runtime/BlendShape/BlendShapeAvatar.cs @@ -4,6 +4,7 @@ using System; using System.Collections.Generic; using UniGLTF; using System.IO; +using UniGLTF.Utils; #if UNITY_EDITOR using UnityEditor; #endif diff --git a/Assets/VRM/Runtime/FirstPerson/VRMFirstPerson.cs b/Assets/VRM/Runtime/FirstPerson/VRMFirstPerson.cs index 61dfbd4dc..b3d050087 100644 --- a/Assets/VRM/Runtime/FirstPerson/VRMFirstPerson.cs +++ b/Assets/VRM/Runtime/FirstPerson/VRMFirstPerson.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Linq; using UniGLTF; using UniGLTF.MeshUtility; +using UniGLTF.Utils; using UnityEngine; diff --git a/Assets/VRM/Runtime/Format/glTF_VRM_FirstPerson.cs b/Assets/VRM/Runtime/Format/glTF_VRM_FirstPerson.cs index 4a65522ce..82a7c3799 100644 --- a/Assets/VRM/Runtime/Format/glTF_VRM_FirstPerson.cs +++ b/Assets/VRM/Runtime/Format/glTF_VRM_FirstPerson.cs @@ -1,8 +1,8 @@ using System; using System.Collections.Generic; using UniGLTF; +using UniGLTF.Utils; using UnityEngine; -using UniJSON; namespace VRM diff --git a/Assets/VRM/Runtime/Format/glTF_VRM_Humanoid.cs b/Assets/VRM/Runtime/Format/glTF_VRM_Humanoid.cs index ec0ee3c65..6477818ba 100644 --- a/Assets/VRM/Runtime/Format/glTF_VRM_Humanoid.cs +++ b/Assets/VRM/Runtime/Format/glTF_VRM_Humanoid.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.Linq; using UniGLTF; +using UniGLTF.Utils; using UnityEngine; namespace VRM diff --git a/Assets/VRM/Runtime/Format/glTF_VRM_Meta.cs b/Assets/VRM/Runtime/Format/glTF_VRM_Meta.cs index f8f6380ae..ac668008c 100644 --- a/Assets/VRM/Runtime/Format/glTF_VRM_Meta.cs +++ b/Assets/VRM/Runtime/Format/glTF_VRM_Meta.cs @@ -1,6 +1,6 @@ using System; using UniGLTF; -using UniJSON; +using UniGLTF.Utils; namespace VRM { diff --git a/Assets/VRM/Runtime/IO/VRMExporter.cs b/Assets/VRM/Runtime/IO/VRMExporter.cs index 72e463bae..907b1aad9 100644 --- a/Assets/VRM/Runtime/IO/VRMExporter.cs +++ b/Assets/VRM/Runtime/IO/VRMExporter.cs @@ -1,10 +1,10 @@ using System; using System.Linq; using UniGLTF; +using UniGLTF.Utils; using UniJSON; using UnityEngine; using VRMShaders; -using ColorSpace = VRMShaders.ColorSpace; namespace VRM { diff --git a/Assets/VRM/Runtime/IO/VRMImporterContext.cs b/Assets/VRM/Runtime/IO/VRMImporterContext.cs index f56edfdf6..669f6991e 100644 --- a/Assets/VRM/Runtime/IO/VRMImporterContext.cs +++ b/Assets/VRM/Runtime/IO/VRMImporterContext.cs @@ -3,8 +3,8 @@ using System.Linq; using System.Collections.Generic; using UniGLTF; using UnityEngine; -using UniJSON; using System.Threading.Tasks; +using UniGLTF.Utils; using VRMShaders; using Object = UnityEngine.Object; diff --git a/Assets/VRM/Runtime/SkinnedMeshUtility/VRMBoneNormalizer.cs b/Assets/VRM/Runtime/SkinnedMeshUtility/VRMBoneNormalizer.cs index 24742bcbe..f3fe1dca7 100644 --- a/Assets/VRM/Runtime/SkinnedMeshUtility/VRMBoneNormalizer.cs +++ b/Assets/VRM/Runtime/SkinnedMeshUtility/VRMBoneNormalizer.cs @@ -1,8 +1,8 @@ using System; using System.Collections.Generic; using System.Linq; -using UniGLTF; using UniGLTF.MeshUtility; +using UniGLTF.Utils; using UniHumanoid; using UnityEngine; diff --git a/Assets/VRM10/Editor/Components/Expression/ReorderableMaterialColorBindingList.cs b/Assets/VRM10/Editor/Components/Expression/ReorderableMaterialColorBindingList.cs index 0baaf81bd..aab93c0d4 100644 --- a/Assets/VRM10/Editor/Components/Expression/ReorderableMaterialColorBindingList.cs +++ b/Assets/VRM10/Editor/Components/Expression/ReorderableMaterialColorBindingList.cs @@ -1,5 +1,5 @@ using System; -using UniGLTF; +using UniGLTF.Utils; using UnityEditor; using UnityEditorInternal; using UnityEngine; diff --git a/Assets/VRM10/Editor/Vrm10InstanceEditor.cs b/Assets/VRM10/Editor/Vrm10InstanceEditor.cs index 35aa561d6..878bbf029 100644 --- a/Assets/VRM10/Editor/Vrm10InstanceEditor.cs +++ b/Assets/VRM10/Editor/Vrm10InstanceEditor.cs @@ -1,6 +1,7 @@ using System.Collections.Generic; using System.Linq; using UniGLTF; +using UniGLTF.Utils; using UnityEditor; using UnityEngine; diff --git a/Assets/VRM10/Runtime/Components/Vrm10Runtime/Vrm10Runtime.cs b/Assets/VRM10/Runtime/Components/Vrm10Runtime/Vrm10Runtime.cs index 6383f8f51..1138f08ee 100644 --- a/Assets/VRM10/Runtime/Components/Vrm10Runtime/Vrm10Runtime.cs +++ b/Assets/VRM10/Runtime/Components/Vrm10Runtime/Vrm10Runtime.cs @@ -2,6 +2,7 @@ using System; using System.Collections.Generic; using System.Linq; using UniGLTF; +using UniGLTF.Utils; using UnityEngine; using UniVRM10.FastSpringBones.Blittables; using UniVRM10.FastSpringBones.System; diff --git a/Assets/VRM10/Runtime/IO/Model/ModelExporter.cs b/Assets/VRM10/Runtime/IO/Model/ModelExporter.cs index a1ad13ecb..dd9e3d044 100644 --- a/Assets/VRM10/Runtime/IO/Model/ModelExporter.cs +++ b/Assets/VRM10/Runtime/IO/Model/ModelExporter.cs @@ -3,9 +3,8 @@ using System.Collections.Generic; using System.Linq; using System.Runtime.InteropServices; using UniGLTF; -using Unity.Collections; +using UniGLTF.Utils; using UnityEngine; -using VrmLib; namespace UniVRM10 { diff --git a/Assets/VRM10/Runtime/IO/Vrm10ImportData.cs b/Assets/VRM10/Runtime/IO/Vrm10ImportData.cs index 37c5bd1f6..ead32ffbe 100644 --- a/Assets/VRM10/Runtime/IO/Vrm10ImportData.cs +++ b/Assets/VRM10/Runtime/IO/Vrm10ImportData.cs @@ -4,6 +4,7 @@ using System.Runtime.InteropServices; using UniGLTF; using VrmLib; using System.Collections.Generic; +using UniGLTF.Utils; using Unity.Collections; using UnityEngine; diff --git a/Assets/VRM10/Runtime/IO/Vrm10Importer.cs b/Assets/VRM10/Runtime/IO/Vrm10Importer.cs index bb70f4f2f..0d6a2b495 100644 --- a/Assets/VRM10/Runtime/IO/Vrm10Importer.cs +++ b/Assets/VRM10/Runtime/IO/Vrm10Importer.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using UniGLTF; +using UniGLTF.Utils; using UnityEngine; using VRMShaders; diff --git a/Assets/VRM10/vrmlib/Runtime/Humanoid/Humanoid.cs b/Assets/VRM10/vrmlib/Runtime/Humanoid/Humanoid.cs index 5dc1c349d..332a5c9bf 100644 --- a/Assets/VRM10/vrmlib/Runtime/Humanoid/Humanoid.cs +++ b/Assets/VRM10/vrmlib/Runtime/Humanoid/Humanoid.cs @@ -2,7 +2,7 @@ using System; using System.Linq; using System.Collections; using System.Collections.Generic; -using UniGLTF; +using UniGLTF.Utils; using UnityEngine; diff --git a/Assets/VRM10/vrmlib/Runtime/Model.cs b/Assets/VRM10/vrmlib/Runtime/Model.cs index eca169da1..2df1be094 100644 --- a/Assets/VRM10/vrmlib/Runtime/Model.cs +++ b/Assets/VRM10/vrmlib/Runtime/Model.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; using UniGLTF; +using UniGLTF.Utils; using Unity.Collections; using UnityEngine; diff --git a/Assets/VRM10_Samples/VRM10Viewer/VRM10ViewerUI.cs b/Assets/VRM10_Samples/VRM10Viewer/VRM10ViewerUI.cs index 62ede917f..b99f1e17e 100644 --- a/Assets/VRM10_Samples/VRM10Viewer/VRM10ViewerUI.cs +++ b/Assets/VRM10_Samples/VRM10Viewer/VRM10ViewerUI.cs @@ -3,6 +3,7 @@ using System.IO; using System.Linq; using System.Threading; using UniGLTF; +using UniGLTF.Utils; using UniHumanoid; using UnityEngine; using UnityEngine.UI;