using System;
using Cpp2IlInjected;
using UnityEngine;

namespace Obi
{
	// Token: 0x02000494 RID: 1172
	[Token(Token = "0x2000494")]
	[ExecuteInEditMode]
	[AddComponentMenu("Physics/Obi/Obi Emitter")]
	public class ObiEmitter : ObiActor
	{
		// Token: 0x170002CC RID: 716
		// (get) Token: 0x060029BC RID: 10684 RVA: 0x0005B124 File Offset: 0x00059324
		// (set) Token: 0x060029BB RID: 10683 RVA: 0x0005B100 File Offset: 0x00059300
		[Token(Token = "0x170002CC")]
		public int NumParticles
		{
			[Token(Token = "0x60029BC")]
			[Address(RVA = "0x6FDC50", Offset = "0x6FCA50", VA = "0x1806FDC50")]
			get
			{
				return this.numParticles;
			}
			[Token(Token = "0x60029BB")]
			[Address(RVA = "0x1011BA0", Offset = "0x10109A0", VA = "0x181011BA0")]
			set
			{
				if (this.numParticles != value)
				{
					this.numParticles = value;
					this.GeneratePhysicRepresentation();
					return;
				}
			}
		}

		// Token: 0x170002CD RID: 717
		// (get) Token: 0x060029BD RID: 10685 RVA: 0x0005B138 File Offset: 0x00059338
		[Token(Token = "0x170002CD")]
		public int ActiveParticles
		{
			[Token(Token = "0x60029BD")]
			[Address(RVA = "0x10118F0", Offset = "0x10106F0", VA = "0x1810118F0")]
			get
			{
				return this.activeParticleCount;
			}
		}

		// Token: 0x170002CE RID: 718
		// (get) Token: 0x060029BE RID: 10686 RVA: 0x0005B14C File Offset: 0x0005934C
		[Token(Token = "0x170002CE")]
		public override bool SelfCollisions
		{
			[Token(Token = "0x60029BE")]
			[Address(RVA = "0xAB46B0", Offset = "0xAB34B0", VA = "0x180AB46B0", Slot = "8")]
			get
			{
				return this.selfCollisions;
			}
		}

		// Token: 0x170002CF RID: 719
		// (get) Token: 0x060029BF RID: 10687 RVA: 0x0005B160 File Offset: 0x00059360
		// (set) Token: 0x060029C0 RID: 10688 RVA: 0x0005B174 File Offset: 0x00059374
		[Token(Token = "0x170002CF")]
		public ObiEmitterShape EmitterShape
		{
			[Token(Token = "0x60029BF")]
			[Address(RVA = "0x436370", Offset = "0x435170", VA = "0x180436370")]
			get
			{
				return this.emitterShape;
			}
			[Token(Token = "0x60029C0")]
			[Address(RVA = "0x1011AF0", Offset = "0x10108F0", VA = "0x181011AF0")]
			set
			{
				if (this.emitterShape != value)
				{
					this.emitterShape = value;
					this.UpdateEmitterDistribution();
				}
			}
		}

		// Token: 0x170002D0 RID: 720
		// (get) Token: 0x060029C2 RID: 10690 RVA: 0x0005B1A0 File Offset: 0x000593A0
		// (set) Token: 0x060029C1 RID: 10689 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x170002D0")]
		public ObiEmitterMaterial EmitterMaterial
		{
			[Token(Token = "0x60029C2")]
			[Address(RVA = "0x436520", Offset = "0x435320", VA = "0x180436520")]
			get
			{
				return this.emitterMaterial;
			}
			[Token(Token = "0x60029C1")]
			[Address(RVA = "0x1011900", Offset = "0x1010700", VA = "0x181011900")]
			set
			{
				throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
			}
		}

		// Token: 0x170002D1 RID: 721
		// (get) Token: 0x060029C3 RID: 10691 RVA: 0x0005B1B4 File Offset: 0x000593B4
		[Token(Token = "0x170002D1")]
		public override bool UsesCustomExternalForces
		{
			[Token(Token = "0x60029C3")]
			[Address(RVA = "0x454840", Offset = "0x453640", VA = "0x180454840", Slot = "12")]
			get
			{
				return true;
			}
		}

		// Token: 0x060029C4 RID: 10692 RVA: 0x0005B1C4 File Offset: 0x000593C4
		[Token(Token = "0x60029C4")]
		[Address(RVA = "0x100F840", Offset = "0x100E640", VA = "0x18100F840", Slot = "13")]
		public override void Awake()
		{
			this.DestroyRequiredComponents();
			this.selfCollisions = true;
			this.GeneratePhysicRepresentation();
		}

		// Token: 0x060029C5 RID: 10693 RVA: 0x0005B1E4 File Offset: 0x000593E4
		[Token(Token = "0x60029C5")]
		[Address(RVA = "0x1010690", Offset = "0x100F490", VA = "0x181010690", 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: 0x060029C6 RID: 10694 RVA: 0x0005B22C File Offset: 0x0005942C
		[Token(Token = "0x60029C6")]
		[Address(RVA = "0x10105A0", Offset = "0x100F3A0", VA = "0x1810105A0", 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: 0x060029C7 RID: 10695 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x60029C7")]
		[Address(RVA = "0x297F00", Offset = "0x296D00", VA = "0x180297F00", Slot = "16")]
		public override void DestroyRequiredComponents()
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x060029C8 RID: 10696 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x60029C8")]
		[Address(RVA = "0x100F7E0", Offset = "0x100E5E0", VA = "0x18100F7E0", Slot = "21")]
		public override bool AddToSolver(object info)
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x060029C9 RID: 10697 RVA: 0x0005B274 File Offset: 0x00059474
		[Token(Token = "0x60029C9")]
		[Address(RVA = "0x1010BB0", Offset = "0x100F9B0", VA = "0x181010BB0", 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: 0x060029CA RID: 10698 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x60029CA")]
		[Address(RVA = "0x100F870", Offset = "0x100E670", VA = "0x18100F870")]
		public void CalculateParticleMass()
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x060029CB RID: 10699 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x60029CB")]
		[Address(RVA = "0x10114B0", Offset = "0x10102B0", VA = "0x1810114B0")]
		public void SetParticleRestRadius()
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x060029CC RID: 10700 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x60029CC")]
		[Address(RVA = "0x100FBE0", Offset = "0x100E9E0", VA = "0x18100FBE0")]
		public void GeneratePhysicRepresentation()
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x060029CD RID: 10701 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x60029CD")]
		[Address(RVA = "0x1011760", Offset = "0x1010560", VA = "0x181011760", Slot = "20")]
		public override void UpdateParticlePhases()
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x060029CE RID: 10702 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x60029CE")]
		[Address(RVA = "0x1011610", Offset = "0x1010410", VA = "0x181011610")]
		private void UpdateEmitterDistribution()
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x060029CF RID: 10703 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x60029CF")]
		[Address(RVA = "0x100FA40", Offset = "0x100E840", VA = "0x18100FA40")]
		private void EmitterMaterial_OnChangesMade(object sender, ObiEmitterMaterial.MaterialChangeEventArgs e)
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x060029D0 RID: 10704 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x60029D0")]
		[Address(RVA = "0x1010C50", Offset = "0x100FA50", VA = "0x181010C50")]
		public void ResetParticlePosition(int index, float offset)
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x060029D1 RID: 10705 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x60029D1")]
		[Address(RVA = "0x100F990", Offset = "0x100E790", VA = "0x18100F990")]
		public bool EmitParticle(float offset)
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x060029D2 RID: 10706 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x60029D2")]
		[Address(RVA = "0x1010370", Offset = "0x100F170", VA = "0x181010370")]
		public bool KillParticle(int index)
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x060029D3 RID: 10707 RVA: 0x0005B2AC File Offset: 0x000594AC
		[Token(Token = "0x60029D3")]
		[Address(RVA = "0x1010310", Offset = "0x100F110", VA = "0x181010310")]
		public void KillAll()
		{
			int num = this.activeParticleCount;
			bool flag = this.KillParticle(num);
			uint num2;
			bool flag2 = ((IObiSolverClient)this).AddToSolver(num2);
		}

		// Token: 0x060029D4 RID: 10708 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x60029D4")]
		[Address(RVA = "0x1010780", Offset = "0x100F580", VA = "0x181010780", Slot = "27")]
		public override void OnSolverStepBegin()
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x060029D5 RID: 10709 RVA: 0x0005B2D0 File Offset: 0x000594D0
		[Token(Token = "0x60029D5")]
		[Address(RVA = "0x10118C0", Offset = "0x10106C0", VA = "0x1810118C0")]
		public ObiEmitter()
		{
		}

		// Token: 0x040032CF RID: 13007
		[FieldOffset(Offset = "0xA8")]
		[Token(Token = "0x40032CF")]
		public int fluidPhase = (int)((ulong)1L);

		// Token: 0x040032D0 RID: 13008
		[FieldOffset(Offset = "0xB0")]
		[Token(Token = "0x40032D0")]
		[SerializeField]
		[HideInInspector]
		private ObiEmitterMaterial emitterMaterial;

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

		// Token: 0x040032D2 RID: 13010
		[FieldOffset(Offset = "0xBC")]
		[Token(Token = "0x40032D2")]
		[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: 0x040032D3 RID: 13011
		[FieldOffset(Offset = "0xC0")]
		[Token(Token = "0x40032D3")]
		[Tooltip("Lifespan of each particle.")]
		public float lifespan = 4f;

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

		// Token: 0x040032D5 RID: 13013
		[FieldOffset(Offset = "0xC8")]
		[Token(Token = "0x40032D5")]
		private ObiEmitterShape emitterShape;

		// Token: 0x040032D6 RID: 13014
		[FieldOffset(Offset = "0xD0")]
		[Token(Token = "0x40032D6")]
		private int activeParticleCount;

		// Token: 0x040032D7 RID: 13015
		[FieldOffset(Offset = "0xD8")]
		[Token(Token = "0x40032D7")]
		[HideInInspector]
		public float[] life;

		// Token: 0x040032D8 RID: 13016
		[FieldOffset(Offset = "0xE0")]
		[Token(Token = "0x40032D8")]
		private float unemittedBursts;
	}
}
