From 846ba5173dfafc5a076cfd29547bc13cb682f468 Mon Sep 17 00:00:00 2001 From: ousttrue Date: Wed, 8 Sep 2021 17:43:52 +0900 Subject: [PATCH] =?UTF-8?q?docfx=20=E3=82=82=20AutoGltfFileParser=20?= =?UTF-8?q?=E3=82=92=E4=BD=BF=E3=81=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docfx/articles/en/gltf/0_82_glb_import.md | 10 ++-------- docfx/articles/ja/gltf/0_82_glb_import.md | 10 ++-------- 2 files changed, 4 insertions(+), 16 deletions(-) diff --git a/docfx/articles/en/gltf/0_82_glb_import.md b/docfx/articles/en/gltf/0_82_glb_import.md index 4350f6a7a..1046f9438 100644 --- a/docfx/articles/en/gltf/0_82_glb_import.md +++ b/docfx/articles/en/gltf/0_82_glb_import.md @@ -58,14 +58,8 @@ See `SimpleViewer` sample. ```cs GltfData Load(string path) { - var ext = Path.GetExtension(path).ToLower(); - switch(ext) - { - case ".glb": return new GlbFileParser(path).Parse(); - case ".gltf": return new GltfFileWithResourceFilesParser(path).Parse(); - case ".zip": return new ZipArchivedGltfFileParser(path).Parse(); - default: throw new Exception($"unknown: {ext}"); - } + // Detect type by file extension automatically + return new AutoGltfFileParser(path).Parse(); } ``` diff --git a/docfx/articles/ja/gltf/0_82_glb_import.md b/docfx/articles/ja/gltf/0_82_glb_import.md index e7dc93c9c..b5c0cfae7 100644 --- a/docfx/articles/ja/gltf/0_82_glb_import.md +++ b/docfx/articles/ja/gltf/0_82_glb_import.md @@ -58,14 +58,8 @@ GltfData Load(string path) ```cs GltfData Load(string path) { - var ext = Path.GetExtension(path).ToLower(); - switch(ext) - { - case ".glb": return new GlbFileParser(path).Parse(); - case ".gltf": return new GltfFileWithResourceFilesParser(path).Parse(); - case ".zip": return new ZipArchivedGltfFileParser(path).Parse(); - default: throw new Exception($"unknown: {ext}"); - } + // ファイル拡張子で自動判定します + return new AutoGltfFileParser(path).Parse(); } ```