From 39531b1ce64444ce56c66ff92b48bacaeeb1ad8a Mon Sep 17 00:00:00 2001 From: momoma-null Date: Wed, 10 Jun 2026 14:54:25 +0900 Subject: [PATCH] =?UTF-8?q?JsonNode=E3=81=B8=E3=81=AE=E3=83=91=E3=83=BC?= =?UTF-8?q?=E3=82=B9=E3=82=92=E5=85=B1=E9=80=9A=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Runtime/UniGLTF/IO/Parser/GlbLowLevelParser.cs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/Packages/UniGLTF/Runtime/UniGLTF/IO/Parser/GlbLowLevelParser.cs b/Packages/UniGLTF/Runtime/UniGLTF/IO/Parser/GlbLowLevelParser.cs index 7b5f4723c..7aac0298a 100644 --- a/Packages/UniGLTF/Runtime/UniGLTF/IO/Parser/GlbLowLevelParser.cs +++ b/Packages/UniGLTF/Runtime/UniGLTF/IO/Parser/GlbLowLevelParser.cs @@ -80,15 +80,14 @@ namespace UniGLTF internal static GltfData ParseGltf(string path, Utf8String json, IReadOnlyList chunks, IStorage storage, MigrationFlags migrationFlags) { - var parsedJson = json.ParseAsJson(); - var GLTF = GltfDeserializer.Deserialize(parsedJson); - if (GLTF.asset.version != "2.0") + var jsonNode = json.ParseAsJson(); + var GLTF = GltfDeserializer.Deserialize(jsonNode); { throw new UniGLTFException("unknown gltf version {0}", GLTF.asset.version); } // Version Compatibility - RestoreOlderVersionValues(parsedJson, GLTF); + RestoreOlderVersionValues(jsonNode, GLTF); FixMeshNameUnique(GLTF); FixBlendShapeNameUnique(GLTF); @@ -306,7 +305,7 @@ namespace UniGLTF } } - private static void RestoreOlderVersionValues(JsonNode parsed, glTF GLTF) + private static void RestoreOlderVersionValues(JsonNode jsonNode, glTF GLTF) { for (int i = 0; i < GLTF.images.Count; ++i) { @@ -314,7 +313,7 @@ namespace UniGLTF { try { - var extraName = parsed["images"][i]["extra"]["name"].Value.GetString(); + var extraName = jsonNode["images"][i]["extra"]["name"].Value.GetString(); if (!string.IsNullOrEmpty(extraName)) { GLTF.images[i].name = extraName;