mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-09-11 13:29:41 -05:00
Define GlbBinaryParser
This commit is contained in:
29
Assets/UniGLTF/Runtime/UniGLTF/IO/Parser/GlbBinaryParser.cs
Normal file
29
Assets/UniGLTF/Runtime/UniGLTF/IO/Parser/GlbBinaryParser.cs
Normal file
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ba0fe1be89e041138d2937dc07e9fdca
|
||||
timeCreated: 1629885479
|
||||
Reference in New Issue
Block a user