diff --git a/Assets/UniGLTF/Runtime/UniGLTF/IO/GltfData.cs b/Assets/UniGLTF/Runtime/UniGLTF/IO/GltfData.cs index 8196458d5..a1fb057e9 100644 --- a/Assets/UniGLTF/Runtime/UniGLTF/IO/GltfData.cs +++ b/Assets/UniGLTF/Runtime/UniGLTF/IO/GltfData.cs @@ -1,6 +1,5 @@ using System; using System.Collections.Generic; -using System.Linq; namespace UniGLTF { @@ -12,27 +11,33 @@ namespace UniGLTF /// public string TargetPath { get; } - /// - /// JSON source - /// - public string Json { get; } - - /// - /// GLTF parsed from JSON - /// - public glTF GLTF { get; } - /// /// Chunk Data. /// Maybe empty if source file was not glb format. + /// https://www.khronos.org/registry/glTF/specs/2.0/glTF-2.0.html#chunks + /// [0] must JSON + /// [1] must BIN + /// [2...] may exists. /// public IReadOnlyList Chunks { get; } /// - /// Bin chunk bytes + /// JSON chunk ToString + /// > This chunk MUST be the very first chunk of Binary glTF asset + /// + public string Json { get; } + + /// + /// GLTF parsed from JSON chunk + /// + public glTF GLTF { get; } + + /// + /// BIN chunk + /// > This chunk MUST be the second chunk of the Binary glTF asset /// /// - public ArraySegment Bin => Chunks.First(x => x.ChunkType == GlbChunkType.BIN).Bytes; + public ArraySegment Bin => Chunks[1].Bytes; /// /// URI access