using System;
using UnityEngine;

namespace LOS
{
	// Token: 0x02000109 RID: 265
	public class Materials
	{
		// Token: 0x1700002F RID: 47
		// (get) Token: 0x0600160D RID: 5645 RVA: 0x0019D1CD File Offset: 0x0019B3CD
		public static Material Mask
		{
			get
			{
				if (Materials.m_MaskMaterial == null)
				{
					Materials.m_MaskMaterial = Materials.CreateMaterial("Shaders/LOSMask");
				}
				return Materials.m_MaskMaterial;
			}
		}

		// Token: 0x17000030 RID: 48
		// (get) Token: 0x0600160E RID: 5646 RVA: 0x0019D1F0 File Offset: 0x0019B3F0
		public static Material Combine
		{
			get
			{
				if (Materials.m_CombineMaterial == null)
				{
					Materials.m_CombineMaterial = Materials.CreateMaterial("Shaders/LOSCombine");
				}
				return Materials.m_CombineMaterial;
			}
		}

		// Token: 0x17000031 RID: 49
		// (get) Token: 0x0600160F RID: 5647 RVA: 0x0019D213 File Offset: 0x0019B413
		public static Material SkyBox
		{
			get
			{
				if (Materials.m_SkyBoxMaterial == null)
				{
					Materials.m_SkyBoxMaterial = Materials.CreateMaterial("Shaders/LOSSkyBox");
				}
				return Materials.m_SkyBoxMaterial;
			}
		}

		// Token: 0x17000032 RID: 50
		// (get) Token: 0x06001610 RID: 5648 RVA: 0x0019D236 File Offset: 0x0019B436
		public static Material StencilRenderer
		{
			get
			{
				if (Materials.m_StencilRenderer == null)
				{
					Materials.m_StencilRenderer = Materials.CreateMaterial("Shaders/LOSStencilRenderer");
				}
				return Materials.m_StencilRenderer;
			}
		}

		// Token: 0x17000033 RID: 51
		// (get) Token: 0x06001611 RID: 5649 RVA: 0x0019D259 File Offset: 0x0019B459
		public static Material StencilMask
		{
			get
			{
				if (Materials.m_StencilMask == null)
				{
					Materials.m_StencilMask = Materials.CreateMaterial("Shaders/LOSStencilMask");
				}
				return Materials.m_StencilMask;
			}
		}

		// Token: 0x17000034 RID: 52
		// (get) Token: 0x06001612 RID: 5650 RVA: 0x0019D27C File Offset: 0x0019B47C
		public static Material Debug
		{
			get
			{
				if (Materials.m_Debug == null)
				{
					Materials.m_Debug = Materials.CreateMaterial("Shaders/LOSDebug");
				}
				return Materials.m_Debug;
			}
		}

		// Token: 0x06001613 RID: 5651 RVA: 0x0019D2A0 File Offset: 0x0019B4A0
		public static void DestroyResources()
		{
			if (Materials.m_MaskMaterial != null)
			{
				Object.DestroyImmediate(Materials.m_MaskMaterial);
				Materials.m_MaskMaterial = null;
			}
			if (Materials.m_CombineMaterial != null)
			{
				Object.DestroyImmediate(Materials.m_CombineMaterial);
				Materials.m_CombineMaterial = null;
			}
			if (Materials.m_SkyBoxMaterial != null)
			{
				Object.DestroyImmediate(Materials.m_SkyBoxMaterial);
				Materials.m_SkyBoxMaterial = null;
			}
			if (Materials.m_StencilRenderer != null)
			{
				Object.DestroyImmediate(Materials.m_StencilRenderer);
				Materials.m_StencilRenderer = null;
			}
			if (Materials.m_StencilMask != null)
			{
				Object.DestroyImmediate(Materials.m_StencilMask);
				Materials.m_StencilMask = null;
			}
			if (Materials.m_Debug != null)
			{
				Object.DestroyImmediate(Materials.m_Debug);
				Materials.m_Debug = null;
			}
		}

		// Token: 0x06001614 RID: 5652 RVA: 0x0019D35C File Offset: 0x0019B55C
		private static Material CreateMaterial(string shaderResource)
		{
			Material material = null;
			Shader shader = Resources.Load(shaderResource, typeof(Shader)) as Shader;
			if (Util.Verify(Shaders.CheckShader(shader)))
			{
				material = new Material(shader);
				material.hideFlags = HideFlags.HideAndDontSave;
			}
			return material;
		}

		// Token: 0x04002620 RID: 9760
		private const string MaskShaderPath = "Shaders/LOSMask";

		// Token: 0x04002621 RID: 9761
		private const string CombineShaderPath = "Shaders/LOSCombine";

		// Token: 0x04002622 RID: 9762
		private const string SkyBoxShaderPath = "Shaders/LOSSkyBox";

		// Token: 0x04002623 RID: 9763
		private const string StencilRendererShaderPath = "Shaders/LOSStencilRenderer";

		// Token: 0x04002624 RID: 9764
		private const string StencilMaskShaderPath = "Shaders/LOSStencilMask";

		// Token: 0x04002625 RID: 9765
		private const string DebugShaderPath = "Shaders/LOSDebug";

		// Token: 0x04002626 RID: 9766
		private static Material m_MaskMaterial;

		// Token: 0x04002627 RID: 9767
		private static Material m_CombineMaterial;

		// Token: 0x04002628 RID: 9768
		private static Material m_SkyBoxMaterial;

		// Token: 0x04002629 RID: 9769
		private static Material m_StencilRenderer;

		// Token: 0x0400262A RID: 9770
		private static Material m_StencilMask;

		// Token: 0x0400262B RID: 9771
		private static Material m_Debug;
	}
}
