using System;
using AmplifyColor;
using Cpp2IlInjected;
using UnityEngine;
using UnityEngine.Serialization;

// Token: 0x02000005 RID: 5
[Token(Token = "0x2000005")]
[ExecuteInEditMode]
[RequireComponent(typeof(Camera))]
[AddComponentMenu("")]
public class AmplifyColorRenderMaskBase : MonoBehaviour
{
	// Token: 0x06000029 RID: 41 RVA: 0x000026E8 File Offset: 0x000008E8
	[Token(Token = "0x6000029")]
	[Address(RVA = "0x8C7C60", Offset = "0x8C6A60", VA = "0x1808C7C60")]
	private void OnEnable()
	{
		Type[] array;
		Type typeFromHandle;
		do
		{
			Camera camera = this.maskCamera;
			int num = 0;
			if (!(camera == num))
			{
				goto IL_7B;
			}
			array = new Type[1];
			typeFromHandle = typeof(Camera);
		}
		while (typeFromHandle != 0 && typeFromHandle == 0);
		array[0] = typeFromHandle;
		GameObject gameObject = new GameObject("Mask Camera", array);
		gameObject.hideFlags = HideFlags.HideAndDontSave;
		Transform transform = gameObject.transform;
		Transform transform2 = base.gameObject.transform;
		transform.parent = transform2;
		Camera component = gameObject.GetComponent<Camera>();
		this.maskCamera = component;
		IL_7B:
		Camera component2 = base.GetComponent<Camera>();
		this.referenceCamera = component2;
		AmplifyColorBase component3 = base.GetComponent<AmplifyColorBase>();
		this.colorEffect = component3;
		Shader shader = Shader.Find("Hidden/RenderMask");
		this.colorMaskShader = shader;
		throw new NullReferenceException();
	}

	// Token: 0x0600002A RID: 42 RVA: 0x000027AC File Offset: 0x000009AC
	[Token(Token = "0x600002A")]
	[Address(RVA = "0x8C7B90", Offset = "0x8C6990", VA = "0x1808C7B90")]
	private void OnDisable()
	{
		Camera camera = this.maskCamera;
		int num = 0;
		if (camera != num)
		{
			UnityEngine.Object.DestroyImmediate(this.maskCamera.gameObject);
			this.maskCamera = (ulong)0L;
		}
		this.DestroyRenderTextures();
	}

	// Token: 0x0600002B RID: 43 RVA: 0x000027F4 File Offset: 0x000009F4
	[Token(Token = "0x600002B")]
	[Address(RVA = "0x8C7A20", Offset = "0x8C6820", VA = "0x1808C7A20")]
	private void DestroyCamera()
	{
		Camera camera = this.maskCamera;
		int num = 0;
		if (camera != num)
		{
			UnityEngine.Object.DestroyImmediate(this.maskCamera.gameObject);
			this.maskCamera = (ulong)0L;
		}
	}

	// Token: 0x0600002C RID: 44 RVA: 0x00002834 File Offset: 0x00000A34
	[Token(Token = "0x600002C")]
	[Address(RVA = "0x8C7AE0", Offset = "0x8C68E0", VA = "0x1808C7AE0")]
	private void DestroyRenderTextures()
	{
		RenderTexture renderTexture = this.maskTexture;
		int num = 0;
		if (renderTexture != num)
		{
			RenderTexture.SetActive(0);
			UnityEngine.Object.DestroyImmediate(this.maskTexture);
			this.maskTexture = (ulong)0L;
		}
	}

	// Token: 0x0600002D RID: 45 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x600002D")]
	[Address(RVA = "0x8C8880", Offset = "0x8C7680", VA = "0x1808C8880")]
	private void UpdateRenderTextures(bool singlePassStereo)
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x0600002E RID: 46 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x600002E")]
	[Address(RVA = "0x8C8760", Offset = "0x8C7560", VA = "0x1808C8760")]
	private void UpdateCameraProperties()
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x0600002F RID: 47 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x600002F")]
	[Address(RVA = "0x8C7EF0", Offset = "0x8C6CF0", VA = "0x1808C7EF0")]
	private void OnPreRender()
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x06000030 RID: 48 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x6000030")]
	[Address(RVA = "0x8C8B40", Offset = "0x8C7940", VA = "0x1808C8B40")]
	public AmplifyColorRenderMaskBase()
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x04000045 RID: 69
	[FieldOffset(Offset = "0x18")]
	[Token(Token = "0x4000045")]
	[FormerlySerializedAs("clearColor")]
	public Color ClearColor;

	// Token: 0x04000046 RID: 70
	[FieldOffset(Offset = "0x28")]
	[Token(Token = "0x4000046")]
	[FormerlySerializedAs("renderLayers")]
	public RenderLayer[] RenderLayers;

	// Token: 0x04000047 RID: 71
	[FieldOffset(Offset = "0x30")]
	[Token(Token = "0x4000047")]
	[FormerlySerializedAs("debug")]
	public bool DebugMask;

	// Token: 0x04000048 RID: 72
	[FieldOffset(Offset = "0x38")]
	[Token(Token = "0x4000048")]
	private Camera referenceCamera;

	// Token: 0x04000049 RID: 73
	[FieldOffset(Offset = "0x40")]
	[Token(Token = "0x4000049")]
	private Camera maskCamera;

	// Token: 0x0400004A RID: 74
	[FieldOffset(Offset = "0x48")]
	[Token(Token = "0x400004A")]
	private AmplifyColorBase colorEffect;

	// Token: 0x0400004B RID: 75
	[FieldOffset(Offset = "0x50")]
	[Token(Token = "0x400004B")]
	private int width;

	// Token: 0x0400004C RID: 76
	[FieldOffset(Offset = "0x54")]
	[Token(Token = "0x400004C")]
	private int height;

	// Token: 0x0400004D RID: 77
	[FieldOffset(Offset = "0x58")]
	[Token(Token = "0x400004D")]
	private RenderTexture maskTexture;

	// Token: 0x0400004E RID: 78
	[FieldOffset(Offset = "0x60")]
	[Token(Token = "0x400004E")]
	private Shader colorMaskShader;

	// Token: 0x0400004F RID: 79
	[FieldOffset(Offset = "0x68")]
	[Token(Token = "0x400004F")]
	private bool singlePassStereo;
}
