using System;
using Bitgem.Core;
using Cpp2IlInjected;
using UnityEngine;

namespace Bitgem.VFX.StylisedWater
{
	// Token: 0x020003DD RID: 989
	[Token(Token = "0x20003DD")]
	[ExecuteInEditMode]
	[RequireComponent(typeof(MeshFilter))]
	public class WaterVolumeBase : MonoBehaviour
	{
		// Token: 0x060024ED RID: 9453 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x60024ED")]
		[Address(RVA = "0x4BC390", Offset = "0x4BB390", VA = "0x1804BC390")]
		private void ensureReferences()
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x060024EE RID: 9454 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x60024EE")]
		[Address(RVA = "0x4BA3D0", Offset = "0x4B93D0", VA = "0x1804BA3D0")]
		public float? GetHeight(Vector3 _position)
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x060024EF RID: 9455 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x60024EF")]
		[Address(RVA = "0x4BA610", Offset = "0x4B9610", VA = "0x1804BA610")]
		public void Rebuild()
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x060024F0 RID: 9456 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x60024F0")]
		[Address(RVA = "0x29E8B0", Offset = "0x29D8B0", VA = "0x18029E8B0", Slot = "4")]
		protected virtual void GenerateTiles(ref bool[,,] _tiles)
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x060024F1 RID: 9457 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x60024F1")]
		[Address(RVA = "0x29E8B0", Offset = "0x29D8B0", VA = "0x18029E8B0", Slot = "5")]
		public virtual void Validate()
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x060024F2 RID: 9458 RVA: 0x000566C4 File Offset: 0x000548C4
		[Token(Token = "0x60024F2")]
		[Address(RVA = "0x4BA5C0", Offset = "0x4B95C0", VA = "0x1804BA5C0")]
		private void OnValidate()
		{
			float num = Mathf.Clamp(this.TileSize, 0.1f, 100f);
			this.TileSize = num;
			this.Validate();
			this.isDirty = true;
		}

		// Token: 0x060024F3 RID: 9459 RVA: 0x000566FC File Offset: 0x000548FC
		[Token(Token = "0x60024F3")]
		[Address(RVA = "0x4BC320", Offset = "0x4BB320", VA = "0x1804BC320")]
		private void Update()
		{
			if (!this.isDirty)
			{
				bool isPlaying = Application.isPlaying;
				if (isPlaying || this.RealtimeUpdates == isPlaying)
				{
					return;
				}
			}
			this.Rebuild();
		}

		// Token: 0x060024F4 RID: 9460 RVA: 0x00056730 File Offset: 0x00054930
		[Token(Token = "0x60024F4")]
		[Address(RVA = "0x4BC360", Offset = "0x4BB360", VA = "0x1804BC360")]
		public WaterVolumeBase()
		{
		}

		// Token: 0x04002E5D RID: 11869
		[Token(Token = "0x4002E5D")]
		public const int MAX_TILES_X = 100;

		// Token: 0x04002E5E RID: 11870
		[Token(Token = "0x4002E5E")]
		public const int MAX_TILES_Y = 50;

		// Token: 0x04002E5F RID: 11871
		[Token(Token = "0x4002E5F")]
		public const int MAX_TILES_Z = 100;

		// Token: 0x04002E60 RID: 11872
		[FieldOffset(Offset = "0x18")]
		[Token(Token = "0x4002E60")]
		protected bool isDirty = true;

		// Token: 0x04002E61 RID: 11873
		[FieldOffset(Offset = "0x20")]
		[Token(Token = "0x4002E61")]
		private Mesh mesh;

		// Token: 0x04002E62 RID: 11874
		[FieldOffset(Offset = "0x28")]
		[Token(Token = "0x4002E62")]
		private MeshFilter meshFilter;

		// Token: 0x04002E63 RID: 11875
		[FieldOffset(Offset = "0x30")]
		[Token(Token = "0x4002E63")]
		private bool[,,] tiles;

		// Token: 0x04002E64 RID: 11876
		[FieldOffset(Offset = "0x38")]
		[Token(Token = "0x4002E64")]
		[FlagEnum]
		public WaterVolumeBase.TileFace IncludeFaces = (WaterVolumeBase.TileFace)((ulong)15L);

		// Token: 0x04002E65 RID: 11877
		[FieldOffset(Offset = "0x3C")]
		[Token(Token = "0x4002E65")]
		[FlagEnum]
		public WaterVolumeBase.TileFace IncludeFoam = (WaterVolumeBase.TileFace)((ulong)15L);

		// Token: 0x04002E66 RID: 11878
		[FieldOffset(Offset = "0x40")]
		[Token(Token = "0x4002E66")]
		[Range(0.1f, 100f)]
		public float TileSize = 1f;

		// Token: 0x04002E67 RID: 11879
		[FieldOffset(Offset = "0x44")]
		[Token(Token = "0x4002E67")]
		public bool ShowDebug = true;

		// Token: 0x04002E68 RID: 11880
		[FieldOffset(Offset = "0x45")]
		[Token(Token = "0x4002E68")]
		public bool RealtimeUpdates;

		// Token: 0x020003DE RID: 990
		[Token(Token = "0x20003DE")]
		[Flags]
		public enum TileFace
		{
			// Token: 0x04002E6A RID: 11882
			[Token(Token = "0x4002E6A")]
			NegX = 1,
			// Token: 0x04002E6B RID: 11883
			[Token(Token = "0x4002E6B")]
			PosX = 2,
			// Token: 0x04002E6C RID: 11884
			[Token(Token = "0x4002E6C")]
			NegZ = 4,
			// Token: 0x04002E6D RID: 11885
			[Token(Token = "0x4002E6D")]
			PosZ = 8
		}
	}
}
