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

namespace Bitgem.VFX.StylisedWater
{
	// Token: 0x02000385 RID: 901
	[Token(Token = "0x2000385")]
	[ExecuteInEditMode]
	[RequireComponent(typeof(MeshFilter))]
	public class WaterVolumeBase : MonoBehaviour
	{
		// Token: 0x06002224 RID: 8740 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002224")]
		[Address(RVA = "0x942310", Offset = "0x941110", VA = "0x180942310")]
		private void ensureReferences()
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x06002225 RID: 8741 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002225")]
		[Address(RVA = "0x940350", Offset = "0x93F150", VA = "0x180940350")]
		public float? GetHeight(Vector3 _position)
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x06002226 RID: 8742 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002226")]
		[Address(RVA = "0x940590", Offset = "0x93F390", VA = "0x180940590")]
		public void Rebuild()
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x06002227 RID: 8743 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002227")]
		[Address(RVA = "0x297F00", Offset = "0x296D00", VA = "0x180297F00", Slot = "4")]
		protected virtual void GenerateTiles(ref bool[,,] _tiles)
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x06002228 RID: 8744 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002228")]
		[Address(RVA = "0x297F00", Offset = "0x296D00", VA = "0x180297F00", Slot = "5")]
		public virtual void Validate()
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x06002229 RID: 8745 RVA: 0x0004F428 File Offset: 0x0004D628
		[Token(Token = "0x6002229")]
		[Address(RVA = "0x940540", Offset = "0x93F340", VA = "0x180940540")]
		private void OnValidate()
		{
			float num = Mathf.Clamp(this.TileSize, 0.1f, 100f);
			this.TileSize = num;
			this.Validate();
			this.isDirty = true;
		}

		// Token: 0x0600222A RID: 8746 RVA: 0x0004F460 File Offset: 0x0004D660
		[Token(Token = "0x600222A")]
		[Address(RVA = "0x9422A0", Offset = "0x9410A0", VA = "0x1809422A0")]
		private void Update()
		{
			if (!this.isDirty)
			{
				bool isPlaying = Application.isPlaying;
				if (isPlaying || this.RealtimeUpdates == isPlaying)
				{
					return;
				}
			}
			this.Rebuild();
		}

		// Token: 0x0600222B RID: 8747 RVA: 0x0004F494 File Offset: 0x0004D694
		[Token(Token = "0x600222B")]
		[Address(RVA = "0x9422E0", Offset = "0x9410E0", VA = "0x1809422E0")]
		public WaterVolumeBase()
		{
		}

		// Token: 0x04002B73 RID: 11123
		[Token(Token = "0x4002B73")]
		public const int MAX_TILES_X = 100;

		// Token: 0x04002B74 RID: 11124
		[Token(Token = "0x4002B74")]
		public const int MAX_TILES_Y = 50;

		// Token: 0x04002B75 RID: 11125
		[Token(Token = "0x4002B75")]
		public const int MAX_TILES_Z = 100;

		// Token: 0x04002B76 RID: 11126
		[FieldOffset(Offset = "0x18")]
		[Token(Token = "0x4002B76")]
		protected bool isDirty = true;

		// Token: 0x04002B77 RID: 11127
		[FieldOffset(Offset = "0x20")]
		[Token(Token = "0x4002B77")]
		private Mesh mesh;

		// Token: 0x04002B78 RID: 11128
		[FieldOffset(Offset = "0x28")]
		[Token(Token = "0x4002B78")]
		private MeshFilter meshFilter;

		// Token: 0x04002B79 RID: 11129
		[FieldOffset(Offset = "0x30")]
		[Token(Token = "0x4002B79")]
		private bool[,,] tiles;

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

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

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

		// Token: 0x04002B7D RID: 11133
		[FieldOffset(Offset = "0x44")]
		[Token(Token = "0x4002B7D")]
		public bool ShowDebug = true;

		// Token: 0x04002B7E RID: 11134
		[FieldOffset(Offset = "0x45")]
		[Token(Token = "0x4002B7E")]
		public bool RealtimeUpdates;

		// Token: 0x02000386 RID: 902
		[Token(Token = "0x2000386")]
		[Flags]
		public enum TileFace
		{
			// Token: 0x04002B80 RID: 11136
			[Token(Token = "0x4002B80")]
			NegX = 1,
			// Token: 0x04002B81 RID: 11137
			[Token(Token = "0x4002B81")]
			PosX = 2,
			// Token: 0x04002B82 RID: 11138
			[Token(Token = "0x4002B82")]
			NegZ = 4,
			// Token: 0x04002B83 RID: 11139
			[Token(Token = "0x4002B83")]
			PosZ = 8
		}
	}
}
