using System;
using UnityEngine;

// Token: 0x02000008 RID: 8
public class SceneMapRender : MonoBehaviour
{
	// Token: 0x06000075 RID: 117 RVA: 0x0000B4D0 File Offset: 0x000096D0
	public void StartRendering()
	{
		this.cam = base.gameObject.GetComponent<Camera>();
		this.cam.clearFlags = CameraClearFlags.Color;
		this.cam.backgroundColor = new Color(0f, 0f, 0f, 0f);
		if (!this.quad)
		{
			this.quad = new GameObject("Fog Background");
			this.quad.transform.parent = base.gameObject.transform;
			MeshFilter meshFilter = this.quad.AddComponent<MeshFilter>();
			MeshRenderer meshRenderer = this.quad.AddComponent<MeshRenderer>();
			meshFilter.mesh = Resources.Load<Mesh>("Crawl/Quad");
			meshRenderer.sharedMaterial = Resources.Load<Material>("Crawl/Fog Background");
			this.quad.transform.localScale = new Vector3(this.cam.orthographicSize * 3f, this.cam.orthographicSize * 3f, 1f);
			this.quad.transform.rotation = Quaternion.Euler(-90f, 0f, 0f);
			this.quad.transform.position = Links.x.diorama.GetOutdoorView().cameraCollider.bounds.center + new Vector3(0f, -1f * Links.x.diorama.sceneInfo.groundY, 0f);
			this.quad.transform.position = new Vector3(this.quad.transform.position.x, Links.x.main.tr.position.y, this.quad.transform.position.z);
			this.quad.layer = 15;
		}
		this.quad.transform.position = new Vector3(this.quad.transform.position.x, Links.x.main.tr.position.y, this.quad.transform.position.z);
		this.quad.SetActive(true);
		this.cam.cullingMask = 32768;
		base.enabled = true;
		this.cam.enabled = true;
		this.cam.depthTextureMode = DepthTextureMode.Depth;
	}

	// Token: 0x06000076 RID: 118 RVA: 0x0000B746 File Offset: 0x00009946
	public void StopRendering()
	{
		this.quad.SetActive(false);
		base.enabled = false;
		this.cam.enabled = false;
	}

	// Token: 0x040001BE RID: 446
	public GameObject quad;

	// Token: 0x040001BF RID: 447
	private Camera cam;

	// Token: 0x040001C0 RID: 448
	private Material fogAddMaterial;
}
