Files
2026-06-04 11:42:34 +02:00

51 lines
1.5 KiB
C#

using System;
using System.Collections.Generic;
using UnityEngine;
namespace UnityStandardAssets.CinematicEffects
{
// Token: 0x0200001E RID: 30
public class RenderTextureUtility
{
// Token: 0x06000061 RID: 97 RVA: 0x00003D8C File Offset: 0x0000218C
public RenderTexture GetTemporaryRenderTexture(int width, int height, int depthBuffer = 0, RenderTextureFormat format = RenderTextureFormat.ARGBHalf, FilterMode filterMode = FilterMode.Bilinear)
{
RenderTexture temporary = RenderTexture.GetTemporary(width, height, depthBuffer, format);
temporary.filterMode = filterMode;
temporary.wrapMode = TextureWrapMode.Clamp;
temporary.name = "RenderTextureUtilityTempTexture";
this.m_TemporaryRTs.Add(temporary);
return temporary;
}
// Token: 0x06000062 RID: 98 RVA: 0x00003DCC File Offset: 0x000021CC
public void ReleaseTemporaryRenderTexture(RenderTexture rt)
{
if (rt == null)
{
return;
}
if (!this.m_TemporaryRTs.Contains(rt))
{
Debug.LogErrorFormat("Attempting to remove texture that was not allocated: {0}", new object[] { rt });
return;
}
this.m_TemporaryRTs.Remove(rt);
RenderTexture.ReleaseTemporary(rt);
}
// Token: 0x06000063 RID: 99 RVA: 0x00003E20 File Offset: 0x00002220
public void ReleaseAllTemporaryRenderTextures()
{
for (int i = 0; i < this.m_TemporaryRTs.Count; i++)
{
RenderTexture.ReleaseTemporary(this.m_TemporaryRTs[i]);
}
this.m_TemporaryRTs.Clear();
}
// Token: 0x04000071 RID: 113
private List<RenderTexture> m_TemporaryRTs = new List<RenderTexture>();
}
}