diff --git a/Assets/UniGLTF/Runtime/UniGLTF/IO/Parser/GlbBinaryParser.cs b/Assets/UniGLTF/Runtime/UniGLTF/IO/Parser/GlbBinaryParser.cs new file mode 100644 index 000000000..e14fe83d8 --- /dev/null +++ b/Assets/UniGLTF/Runtime/UniGLTF/IO/Parser/GlbBinaryParser.cs @@ -0,0 +1,29 @@ +using System; + +namespace UniGLTF +{ + public sealed class GlbBinaryParser + { + private readonly byte[] _data; + private readonly string _name; + + public GlbBinaryParser(byte[] data, string uniqueName) + { + _data = data; + + if (string.IsNullOrWhiteSpace(uniqueName)) + { + _name = Guid.NewGuid().ToString(); + } + else + { + _name = uniqueName; + } + } + + public GltfData Parse() + { + return new GlbLowLevelParser(_name, _data).Parse(); + } + } +} \ No newline at end of file diff --git a/Assets/UniGLTF/Runtime/UniGLTF/IO/Parser/GlbBinaryParser.cs.meta b/Assets/UniGLTF/Runtime/UniGLTF/IO/Parser/GlbBinaryParser.cs.meta new file mode 100644 index 000000000..436942160 --- /dev/null +++ b/Assets/UniGLTF/Runtime/UniGLTF/IO/Parser/GlbBinaryParser.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: ba0fe1be89e041138d2937dc07e9fdca +timeCreated: 1629885479 \ No newline at end of file