docfx も AutoGltfFileParser を使う

This commit is contained in:
ousttrue
2021-09-08 17:43:52 +09:00
parent 872888a35a
commit 846ba5173d
2 changed files with 4 additions and 16 deletions

View File

@@ -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();
}
```

View File

@@ -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();
}
```