diff --git a/Assets/UniGLTF/Runtime/UniGLTF/Format/ArraySegmentByteBuffer.cs b/Assets/UniGLTF/Runtime/UniGLTF/Format/ArraySegmentByteBuffer.cs deleted file mode 100644 index 2b7f9e570..000000000 --- a/Assets/UniGLTF/Runtime/UniGLTF/Format/ArraySegmentByteBuffer.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System; - - -namespace UniGLTF -{ - /// - /// for glb chunk buffer read - /// - public class ArraySegmentByteBuffer - { - ArraySegment m_bytes; - - public ArraySegmentByteBuffer(ArraySegment bytes) - { - m_bytes = bytes; - } - - public string Uri - { - get; - private set; - } - - public glTFBufferView Extend(ArraySegment array, glBufferTarget target) where T : struct - { - throw new NotImplementedException(); - } - - public void ExtendCapacity(int capacity) - { - throw new NotImplementedException(); - } - - public ArraySegment Bytes => m_bytes; - } -} diff --git a/Assets/UniGLTF/Runtime/UniGLTF/Format/ArraySegmentByteBuffer.cs.meta b/Assets/UniGLTF/Runtime/UniGLTF/Format/ArraySegmentByteBuffer.cs.meta deleted file mode 100644 index 3236a085e..000000000 --- a/Assets/UniGLTF/Runtime/UniGLTF/Format/ArraySegmentByteBuffer.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: f857b8b7ca45b1746af90c7fb86b2398 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/VRM10/Runtime/IO/Vrm10ImportData.cs b/Assets/VRM10/Runtime/IO/Vrm10ImportData.cs index 32d4bcbce..e85266bea 100644 --- a/Assets/VRM10/Runtime/IO/Vrm10ImportData.cs +++ b/Assets/VRM10/Runtime/IO/Vrm10ImportData.cs @@ -33,7 +33,7 @@ namespace UniVRM10 public UniGLTF.Extensions.VRMC_springBone.VRMC_springBone gltfVrmSpringBone; - ArraySegmentByteBuffer _buffer; + byte[] _bin; /// /// for import @@ -56,7 +56,7 @@ namespace UniVRM10 gltfVrmSpringBone = springBone; } - _buffer = new ArraySegmentByteBuffer(new ArraySegment(data.Bin.ToArray())); + _bin = m_data.Bin.ToArray(); } public ArraySegment GetBufferBytes(UniGLTF.glTFBufferView bufferView) @@ -75,7 +75,7 @@ namespace UniVRM10 { throw new NotImplementedException(); } - return _buffer.Bytes; + return new ArraySegment(_bin); } static ArraySegment RestoreSparseAccessorUInt16(ArraySegment bytes, int accessorCount, ArraySegment indicesBytes, ArraySegment valuesBytes) @@ -137,9 +137,8 @@ namespace UniVRM10 if (view.buffer.TryGetValidIndex(Gltf.buffers.Count, out int bufferIndex)) { var buffer = m_data.Bin; - var bin = _buffer.Bytes; var byteSize = accessor.CalcByteSize(); - bytes = bin.Slice(view.byteOffset, view.byteLength).Slice(accessor.byteOffset, byteSize); + bytes = new ArraySegment(_bin).Slice(view.byteOffset, view.byteLength).Slice(accessor.byteOffset, byteSize); } }