scripts
This commit is contained in:
@@ -0,0 +1,91 @@
|
||||
using System;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
using UnityEngine.Scripting;
|
||||
|
||||
namespace UnityEngine.Networking
|
||||
{
|
||||
// Token: 0x0200029C RID: 668
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public sealed class DownloadHandlerTexture : DownloadHandler
|
||||
{
|
||||
// Token: 0x06002D5D RID: 11613 RVA: 0x00040360 File Offset: 0x0003E560
|
||||
public DownloadHandlerTexture()
|
||||
{
|
||||
this.InternalCreateTexture(true);
|
||||
}
|
||||
|
||||
// Token: 0x06002D5E RID: 11614 RVA: 0x00040370 File Offset: 0x0003E570
|
||||
[RequiredByNativeCode]
|
||||
public DownloadHandlerTexture(bool readable)
|
||||
{
|
||||
this.InternalCreateTexture(readable);
|
||||
this.mNonReadable = !readable;
|
||||
}
|
||||
|
||||
// Token: 0x06002D5F RID: 11615
|
||||
[GeneratedByOldBindingsGenerator]
|
||||
[MethodImpl(MethodImplOptions.InternalCall)]
|
||||
internal extern void InternalCreateTexture(bool readable);
|
||||
|
||||
// Token: 0x06002D60 RID: 11616 RVA: 0x0004038C File Offset: 0x0003E58C
|
||||
protected override byte[] GetData()
|
||||
{
|
||||
return this.InternalGetData();
|
||||
}
|
||||
|
||||
// Token: 0x17000A47 RID: 2631
|
||||
// (get) Token: 0x06002D61 RID: 11617 RVA: 0x000403A8 File Offset: 0x0003E5A8
|
||||
public Texture2D texture
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.InternalGetTexture();
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06002D62 RID: 11618 RVA: 0x000403C4 File Offset: 0x0003E5C4
|
||||
private Texture2D InternalGetTexture()
|
||||
{
|
||||
if (this.mHasTexture)
|
||||
{
|
||||
if (this.mTexture == null)
|
||||
{
|
||||
this.mTexture = new Texture2D(2, 2);
|
||||
this.mTexture.LoadImage(this.GetData(), this.mNonReadable);
|
||||
}
|
||||
}
|
||||
else if (this.mTexture == null)
|
||||
{
|
||||
this.mTexture = this.InternalGetTextureNative();
|
||||
this.mHasTexture = true;
|
||||
}
|
||||
return this.mTexture;
|
||||
}
|
||||
|
||||
// Token: 0x06002D63 RID: 11619
|
||||
[GeneratedByOldBindingsGenerator]
|
||||
[MethodImpl(MethodImplOptions.InternalCall)]
|
||||
private extern Texture2D InternalGetTextureNative();
|
||||
|
||||
// Token: 0x06002D64 RID: 11620
|
||||
[GeneratedByOldBindingsGenerator]
|
||||
[MethodImpl(MethodImplOptions.InternalCall)]
|
||||
private extern byte[] InternalGetData();
|
||||
|
||||
// Token: 0x06002D65 RID: 11621 RVA: 0x00040450 File Offset: 0x0003E650
|
||||
public static Texture2D GetContent(UnityWebRequest www)
|
||||
{
|
||||
return DownloadHandler.GetCheckedDownloader<DownloadHandlerTexture>(www).texture;
|
||||
}
|
||||
|
||||
// Token: 0x040008A4 RID: 2212
|
||||
private Texture2D mTexture;
|
||||
|
||||
// Token: 0x040008A5 RID: 2213
|
||||
private bool mHasTexture;
|
||||
|
||||
// Token: 0x040008A6 RID: 2214
|
||||
private bool mNonReadable;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user