diff --git a/Assets/UniGLTF/Runtime/UniGLTF/IO/UriByteBuffer.cs b/Assets/UniGLTF/Runtime/UniGLTF/IO/UriByteBuffer.cs index 2ca07a1ab..e2cb3acc0 100644 --- a/Assets/UniGLTF/Runtime/UniGLTF/IO/UriByteBuffer.cs +++ b/Assets/UniGLTF/Runtime/UniGLTF/IO/UriByteBuffer.cs @@ -1,40 +1,9 @@ using System; -using System.IO; namespace UniGLTF { - /// - /// for buffer with uri read - /// - public class UriByteBuffer : IBytesBuffer + public static class UriByteBuffer { - public string Uri - { - get; - private set; - } - - Byte[] m_bytes; - public ArraySegment Bytes => new ArraySegment(m_bytes); - - public UriByteBuffer(string baseDir, string uri) - { - Uri = uri; - m_bytes = ReadFromUri(baseDir, uri); - } - - const string DataPrefix = "data:application/octet-stream;base64,"; - - const string DataPrefix2 = "data:application/gltf-buffer;base64,"; - - const string DataPrefix3 = "data:image/jpeg;base64,"; - - [Obsolete("Use ReadEmbedded(uri)")] - public static Byte[] ReadEmbeded(string uri) - { - return ReadEmbedded(uri); - } - public static Byte[] ReadEmbedded(string uri) { var pos = uri.IndexOf(";base64,"); @@ -47,29 +16,5 @@ namespace UniGLTF return Convert.FromBase64String(uri.Substring(pos + 8)); } } - - Byte[] ReadFromUri(string baseDir, string uri) - { - var bytes = ReadEmbedded(uri); - if (bytes != null) - { - return bytes; - } - else - { - // as local file path - return File.ReadAllBytes(Path.Combine(baseDir, uri)); - } - } - - public glTFBufferView Extend(ArraySegment array, glBufferTarget target) where T : struct - { - throw new NotImplementedException(); - } - - public void ExtendCapacity(int capacity) - { - throw new NotImplementedException(); - } } }