diff --git a/Scripts/Format/VRMImporter.cs b/Scripts/Format/VRMImporter.cs index 012d415b0..cf9950016 100644 --- a/Scripts/Format/VRMImporter.cs +++ b/Scripts/Format/VRMImporter.cs @@ -14,13 +14,23 @@ namespace VRM [Obsolete("use VRMImporterContext.Load(path)")] public static GameObject LoadFromPath(string path) { - return VRMImporterContext.Load(path).Root; + var context = new VRMImporterContext(); + context.Parse(path, File.ReadAllBytes(path)); + context.Load(); + context.ShowMeshes(); + context.EnableUpdateWhenOffscreen(); + return context.Root; } [Obsolete("use VRMImporterContext.Load(bytes)")] public static GameObject LoadFromBytes(Byte[] bytes) { - return VRMImporterContext.Load(bytes).Root; + var context = new VRMImporterContext(); + context.ParseGlb(bytes); + context.Load(); + context.ShowMeshes(); + context.EnableUpdateWhenOffscreen(); + return context.Root; } [Obsolete("use VRMImporterContext.Load()")] @@ -28,6 +38,7 @@ namespace VRM { context.Load(); context.ShowMeshes(); + context.EnableUpdateWhenOffscreen(); } #region LoadVrmAsync diff --git a/Scripts/Format/VRMImporterContext.cs b/Scripts/Format/VRMImporterContext.cs index 392a17c6e..13dd4015f 100644 --- a/Scripts/Format/VRMImporterContext.cs +++ b/Scripts/Format/VRMImporterContext.cs @@ -2,7 +2,6 @@ using System; using System.Linq; using System.Collections.Generic; -using System.IO; using UniGLTF; using UnityEngine; @@ -14,24 +13,13 @@ namespace VRM const string HUMANOID_KEY = "humanoid"; const string MATERIAL_KEY = "materialProperties"; - public VRMImporterContext(UnityPath gltfPath = default(UnityPath)) : base(gltfPath) + [Obsolete] + public VRMImporterContext(UnityPath gltfPath) : base(gltfPath) { } - public static VRMImporterContext Load(string path) + public VRMImporterContext() { - var context = new VRMImporterContext(UniGLTF.UnityPath.FromFullpath(path)); - context.ParseGlb(File.ReadAllBytes(path)); - context.Load(); - return context; - } - - public static VRMImporterContext Load(Byte[] bytes) - { - var context = new VRMImporterContext(); - context.ParseGlb(bytes); - context.Load(); - return context; } public override void Load() diff --git a/UniGLTF b/UniGLTF index e0c90f42c..5595029d7 160000 --- a/UniGLTF +++ b/UniGLTF @@ -1 +1 @@ -Subproject commit e0c90f42cc192b42d45be53c9fd5551cbe1b1984 +Subproject commit 5595029d7446fa4c1a8136dc47527c87c5a89fdd