@@ -26,7 +26,7 @@ public BinaryDownloadProvider(Dictionary<string, string> content)
2626 /// </summary>
2727 /// <param name="url">URI to request</param>
2828 /// <returns>Object representing the request</returns>
29- public async Task < IDownload > Request ( Uri url )
29+ public async Task < IDownload > RequestAsync ( Uri url )
3030 {
3131 var req = new AwaitableDownload ( url ) ;
3232 await req . WaitAsync ( ) ;
@@ -39,7 +39,7 @@ public async Task<IDownload> Request(Uri url)
3939 /// <param name="url">URI to request</param>
4040 /// <param name="nonReadable">If true, resulting texture is not CPU readable (uses less memory)</param>
4141 /// <returns>Object representing the request</returns>
42- public async Task < ITextureDownload > RequestTexture ( Uri url , bool nonReadable )
42+ public async Task < ITextureDownload > RequestTextureAsync ( Uri url , bool nonReadable , bool forceLinear )
4343 {
4444 var fileName = Path . GetFileName ( url . LocalPath ) ;
4545 var file = _content [ fileName ] ;
@@ -159,10 +159,6 @@ public void Dispose()
159159
160160 public class AwaitableTextureDownload : AwaitableDownload , ITextureDownload
161161 {
162-
163- /// <inheritdoc />
164- public Texture2D Texture => ( m_Request ? . downloadHandler as DownloadHandlerTexture ) ? . texture ;
165-
166162 /// <summary>
167163 /// Parameter-less constructor, required for inheritance.
168164 /// </summary>
@@ -196,5 +192,17 @@ void Init(Uri url, bool nonReadable)
196192 m_Request = CreateRequest ( url , nonReadable ) ;
197193 m_AsyncOperation = m_Request . SendWebRequest ( ) ;
198194 }
195+
196+ /// <inheritdoc />
197+ public IDisposableTexture GetTexture ( bool linear )
198+ {
199+ return ( m_Request ? . downloadHandler as DownloadHandlerTexture ) ? . texture . ToDisposableTexture ( ) ;
200+ }
201+ }
202+
203+ internal static class DisposableTextureExtensions
204+ {
205+ internal static IDisposableTexture ToDisposableTexture ( this Texture2D texture2D ) =>
206+ new NonReusableTexture ( texture2D ) ;
199207 }
200208}
0 commit comments