using System;
using Cpp2IlInjected;
using UnityEngine;

namespace Obi
{
	// Token: 0x020004EC RID: 1260
	[Token(Token = "0x20004EC")]
	[ExecuteInEditMode]
	[AddComponentMenu("Physics/Obi/Obi Emitter")]
	public class ObiEmitter : ObiActor
	{
		// Token: 0x170002F1 RID: 753
		// (get) Token: 0x06002C85 RID: 11397 RVA: 0x000624E8 File Offset: 0x000606E8
		// (set) Token: 0x06002C84 RID: 11396 RVA: 0x000624C4 File Offset: 0x000606C4
		[Token(Token = "0x170002F1")]
		public int NumParticles
		{
			[Token(Token = "0x6002C85")]
			[Address(RVA = "0x771990", Offset = "0x770990", VA = "0x180771990")]
			get
			{
				return this.numParticles;
			}
			[Token(Token = "0x6002C84")]
			[Address(RVA = "0x10A4ED0", Offset = "0x10A3ED0", VA = "0x1810A4ED0")]
			set
			{
				if (this.numParticles != value)
				{
					this.numParticles = value;
					this.GeneratePhysicRepresentation();
					return;
				}
			}
		}

		// Token: 0x170002F2 RID: 754
		// (get) Token: 0x06002C86 RID: 11398 RVA: 0x000624FC File Offset: 0x000606FC
		[Token(Token = "0x170002F2")]
		public int ActiveParticles
		{
			[Token(Token = "0x6002C86")]
			[Address(RVA = "0x10A4C20", Offset = "0x10A3C20", VA = "0x1810A4C20")]
			get
			{
				return this.activeParticleCount;
			}
		}

		// Token: 0x170002F3 RID: 755
		// (get) Token: 0x06002C87 RID: 11399 RVA: 0x00062510 File Offset: 0x00060710
		[Token(Token = "0x170002F3")]
		public override bool SelfCollisions
		{
			[Token(Token = "0x6002C87")]
			[Address(RVA = "0xF24710", Offset = "0xF23710", VA = "0x180F24710", Slot = "8")]
			get
			{
				return this.selfCollisions;
			}
		}

		// Token: 0x170002F4 RID: 756
		// (get) Token: 0x06002C88 RID: 11400 RVA: 0x00062524 File Offset: 0x00060724
		// (set) Token: 0x06002C89 RID: 11401 RVA: 0x00062538 File Offset: 0x00060738
		[Token(Token = "0x170002F4")]
		public ObiEmitterShape EmitterShape
		{
			[Token(Token = "0x6002C88")]
			[Address(RVA = "0x614C40", Offset = "0x613C40", VA = "0x180614C40")]
			get
			{
				return this.emitterShape;
			}
			[Token(Token = "0x6002C89")]
			[Address(RVA = "0x10A4E20", Offset = "0x10A3E20", VA = "0x1810A4E20")]
			set
			{
				if (this.emitterShape != value)
				{
					this.emitterShape = value;
					this.UpdateEmitterDistribution();
				}
			}
		}

		// Token: 0x170002F5 RID: 757
		// (get) Token: 0x06002C8B RID: 11403 RVA: 0x00062564 File Offset: 0x00060764
		// (set) Token: 0x06002C8A RID: 11402 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x170002F5")]
		public ObiEmitterMaterial EmitterMaterial
		{
			[Token(Token = "0x6002C8B")]
			[Address(RVA = "0x4D0F50", Offset = "0x4CFF50", VA = "0x1804D0F50")]
			get
			{
				return this.emitterMaterial;
			}
			[Token(Token = "0x6002C8A")]
			[Address(RVA = "0x10A4C30", Offset = "0x10A3C30", VA = "0x1810A4C30")]
			set
			{
				throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
			}
		}

		// Token: 0x170002F6 RID: 758
		// (get) Token: 0x06002C8C RID: 11404 RVA: 0x00062578 File Offset: 0x00060778
		[Token(Token = "0x170002F6")]
		public override bool UsesCustomExternalForces
		{
			[Token(Token = "0x6002C8C")]
			[Address(RVA = "0x4990D0", Offset = "0x4980D0", VA = "0x1804990D0", Slot = "12")]
			get
			{
				return true;
			}
		}

		// Token: 0x06002C8D RID: 11405 RVA: 0x00062588 File Offset: 0x00060788
		[Token(Token = "0x6002C8D")]
		[Address(RVA = "0x10A2B70", Offset = "0x10A1B70", VA = "0x1810A2B70", Slot = "13")]
		public override void Awake()
		{
			this.DestroyRequiredComponents();
			this.selfCollisions = true;
			this.GeneratePhysicRepresentation();
		}

		// Token: 0x06002C8E RID: 11406 RVA: 0x000625A8 File Offset: 0x000607A8
		[Token(Token = "0x6002C8E")]
		[Address(RVA = "0x10A39C0", Offset = "0x10A29C0", VA = "0x1810A39C0", Slot = "17")]
		public override void OnEnable()
		{
			ObiEmitterMaterial obiEmitterMaterial = this.emitterMaterial;
			int num = 0;
			if (obiEmitterMaterial != num)
			{
				ObiEmitterMaterial obiEmitterMaterial2 = this.emitterMaterial;
				EventHandler<ObiEmitterMaterial.MaterialChangeEventArgs> eventHandler = new EventHandler(this.EmitterMaterial_OnChangesMade);
				obiEmitterMaterial2.OnChangesMade += eventHandler;
			}
			base.OnEnable();
		}

		// Token: 0x06002C8F RID: 11407 RVA: 0x000625F0 File Offset: 0x000607F0
		[Token(Token = "0x6002C8F")]
		[Address(RVA = "0x10A38D0", Offset = "0x10A28D0", VA = "0x1810A38D0", Slot = "18")]
		public override void OnDisable()
		{
			ObiEmitterMaterial obiEmitterMaterial = this.emitterMaterial;
			int num = 0;
			if (obiEmitterMaterial != num)
			{
				ObiEmitterMaterial obiEmitterMaterial2 = this.emitterMaterial;
				EventHandler<ObiEmitterMaterial.MaterialChangeEventArgs> eventHandler = new EventHandler(this.EmitterMaterial_OnChangesMade);
				obiEmitterMaterial2.OnChangesMade -= eventHandler;
			}
			base.OnDisable();
		}

		// Token: 0x06002C90 RID: 11408 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002C90")]
		[Address(RVA = "0x29E8B0", Offset = "0x29D8B0", VA = "0x18029E8B0", Slot = "16")]
		public override void DestroyRequiredComponents()
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x06002C91 RID: 11409 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002C91")]
		[Address(RVA = "0x10A2B10", Offset = "0x10A1B10", VA = "0x1810A2B10", Slot = "21")]
		public override bool AddToSolver(object info)
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x06002C92 RID: 11410 RVA: 0x00062638 File Offset: 0x00060838
		[Token(Token = "0x6002C92")]
		[Address(RVA = "0x10A3EE0", Offset = "0x10A2EE0", VA = "0x1810A3EE0", Slot = "22")]
		public override bool RemoveFromSolver(object info)
		{
			ObiSolver solver = this.solver;
			int num = 0;
			if (solver != num)
			{
				this.solver.RelinquishRenderablePositions();
			}
			return base.RemoveFromSolver(info);
		}

		// Token: 0x06002C93 RID: 11411 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002C93")]
		[Address(RVA = "0x10A2BA0", Offset = "0x10A1BA0", VA = "0x1810A2BA0")]
		public void CalculateParticleMass()
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x06002C94 RID: 11412 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002C94")]
		[Address(RVA = "0x10A47E0", Offset = "0x10A37E0", VA = "0x1810A47E0")]
		public void SetParticleRestRadius()
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x06002C95 RID: 11413 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002C95")]
		[Address(RVA = "0x10A2F10", Offset = "0x10A1F10", VA = "0x1810A2F10")]
		public void GeneratePhysicRepresentation()
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x06002C96 RID: 11414 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002C96")]
		[Address(RVA = "0x10A4A90", Offset = "0x10A3A90", VA = "0x1810A4A90", Slot = "20")]
		public override void UpdateParticlePhases()
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x06002C97 RID: 11415 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002C97")]
		[Address(RVA = "0x10A4940", Offset = "0x10A3940", VA = "0x1810A4940")]
		private void UpdateEmitterDistribution()
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x06002C98 RID: 11416 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002C98")]
		[Address(RVA = "0x10A2D70", Offset = "0x10A1D70", VA = "0x1810A2D70")]
		private void EmitterMaterial_OnChangesMade(object sender, ObiEmitterMaterial.MaterialChangeEventArgs e)
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x06002C99 RID: 11417 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002C99")]
		[Address(RVA = "0x10A3F80", Offset = "0x10A2F80", VA = "0x1810A3F80")]
		public void ResetParticlePosition(int index, float offset)
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x06002C9A RID: 11418 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002C9A")]
		[Address(RVA = "0x10A2CC0", Offset = "0x10A1CC0", VA = "0x1810A2CC0")]
		public bool EmitParticle(float offset)
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x06002C9B RID: 11419 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002C9B")]
		[Address(RVA = "0x10A36A0", Offset = "0x10A26A0", VA = "0x1810A36A0")]
		public bool KillParticle(int index)
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x06002C9C RID: 11420 RVA: 0x00062670 File Offset: 0x00060870
		[Token(Token = "0x6002C9C")]
		[Address(RVA = "0x10A3640", Offset = "0x10A2640", VA = "0x1810A3640")]
		public void KillAll()
		{
			int num = this.activeParticleCount;
			bool flag = this.KillParticle(num);
			long valueAsLong = base.ValueAsLong;
		}

		// Token: 0x06002C9D RID: 11421 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002C9D")]
		[Address(RVA = "0x10A3AB0", Offset = "0x10A2AB0", VA = "0x1810A3AB0", Slot = "27")]
		public override void OnSolverStepBegin()
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x06002C9E RID: 11422 RVA: 0x00062694 File Offset: 0x00060894
		[Token(Token = "0x6002C9E")]
		[Address(RVA = "0x10A4BF0", Offset = "0x10A3BF0", VA = "0x1810A4BF0")]
		public ObiEmitter()
		{
		}

		// Token: 0x040035B9 RID: 13753
		[FieldOffset(Offset = "0xA8")]
		[Token(Token = "0x40035B9")]
		public int fluidPhase = (int)((ulong)1L);

		// Token: 0x040035BA RID: 13754
		[FieldOffset(Offset = "0xB0")]
		[Token(Token = "0x40035BA")]
		[SerializeField]
		[HideInInspector]
		private ObiEmitterMaterial emitterMaterial;

		// Token: 0x040035BB RID: 13755
		[FieldOffset(Offset = "0xB8")]
		[Token(Token = "0x40035BB")]
		[HideInInspector]
		[SerializeField]
		[Tooltip("Amount of solver particles used by this emitter.")]
		private int numParticles = (int)((ulong)1000L);

		// Token: 0x040035BC RID: 13756
		[FieldOffset(Offset = "0xBC")]
		[Token(Token = "0x40035BC")]
		[Tooltip("Speed (in units/second) of emitted particles. Setting it to zero will stop emission. Large values will cause more particles to be emitted.")]
		public float speed = 0.25f;

		// Token: 0x040035BD RID: 13757
		[FieldOffset(Offset = "0xC0")]
		[Token(Token = "0x40035BD")]
		[Tooltip("Lifespan of each particle.")]
		public float lifespan = 4f;

		// Token: 0x040035BE RID: 13758
		[FieldOffset(Offset = "0xC4")]
		[Token(Token = "0x40035BE")]
		[Range(0f, 1f)]
		[Tooltip("Amount of randomization applied to particles.")]
		public float randomVelocity;

		// Token: 0x040035BF RID: 13759
		[FieldOffset(Offset = "0xC8")]
		[Token(Token = "0x40035BF")]
		private ObiEmitterShape emitterShape;

		// Token: 0x040035C0 RID: 13760
		[FieldOffset(Offset = "0xD0")]
		[Token(Token = "0x40035C0")]
		private int activeParticleCount;

		// Token: 0x040035C1 RID: 13761
		[FieldOffset(Offset = "0xD8")]
		[Token(Token = "0x40035C1")]
		[HideInInspector]
		public float[] life;

		// Token: 0x040035C2 RID: 13762
		[FieldOffset(Offset = "0xE0")]
		[Token(Token = "0x40035C2")]
		private float unemittedBursts;
	}
}
