using System;
using System.Runtime.CompilerServices;
using Cpp2IlInjected;
using UnityEngine;

namespace Obi
{
	// Token: 0x020004E7 RID: 1255
	[Token(Token = "0x20004E7")]
	public class ObiClothPicker : MonoBehaviour
	{
		// Token: 0x1400001E RID: 30
		// (add) Token: 0x06002BF1 RID: 11249 RVA: 0x0005ED88 File Offset: 0x0005CF88
		// (remove) Token: 0x06002BF2 RID: 11250 RVA: 0x0005EDB8 File Offset: 0x0005CFB8
		[Token(Token = "0x1400001E")]
		public event EventHandler<ObiClothPicker.ParticlePickEventArgs> OnParticlePicked
		{
			[Token(Token = "0x6002BF1")]
			[Address(RVA = "0x1005090", Offset = "0x1003E90", VA = "0x181005090")]
			[CompilerGenerated]
			add
			{
				EventHandler<ObiClothPicker.ParticlePickEventArgs> onParticlePicked = this.OnParticlePicked;
				Delegate @delegate = Delegate.Combine(onParticlePicked, value);
				if (@delegate == 0 || @delegate != 0)
				{
					while (@delegate != onParticlePicked)
					{
					}
					return;
				}
				throw new InvalidCastException();
			}
			[Token(Token = "0x6002BF2")]
			[Address(RVA = "0x1005310", Offset = "0x1004110", VA = "0x181005310")]
			[CompilerGenerated]
			remove
			{
				EventHandler<ObiClothPicker.ParticlePickEventArgs> onParticlePicked = this.OnParticlePicked;
				Delegate @delegate = Delegate.Remove(onParticlePicked, value);
				if (@delegate == 0 || @delegate != 0)
				{
					while (@delegate != onParticlePicked)
					{
					}
					return;
				}
				throw new InvalidCastException();
			}
		}

		// Token: 0x1400001F RID: 31
		// (add) Token: 0x06002BF3 RID: 11251 RVA: 0x0005EDE8 File Offset: 0x0005CFE8
		// (remove) Token: 0x06002BF4 RID: 11252 RVA: 0x0005EE18 File Offset: 0x0005D018
		[Token(Token = "0x1400001F")]
		public event EventHandler<ObiClothPicker.ParticlePickEventArgs> OnParticleHeld
		{
			[Token(Token = "0x6002BF3")]
			[Address(RVA = "0x1004FF0", Offset = "0x1003DF0", VA = "0x181004FF0")]
			[CompilerGenerated]
			add
			{
				EventHandler<ObiClothPicker.ParticlePickEventArgs> onParticleHeld = this.OnParticleHeld;
				Delegate @delegate = Delegate.Combine(onParticleHeld, value);
				if (@delegate == 0 || @delegate != 0)
				{
					while (@delegate != onParticleHeld)
					{
					}
					return;
				}
				throw new InvalidCastException();
			}
			[Token(Token = "0x6002BF4")]
			[Address(RVA = "0x1005270", Offset = "0x1004070", VA = "0x181005270")]
			[CompilerGenerated]
			remove
			{
				EventHandler<ObiClothPicker.ParticlePickEventArgs> onParticleHeld = this.OnParticleHeld;
				Delegate @delegate = Delegate.Remove(onParticleHeld, value);
				if (@delegate == 0 || @delegate != 0)
				{
					while (@delegate != onParticleHeld)
					{
					}
					return;
				}
				throw new InvalidCastException();
			}
		}

		// Token: 0x14000020 RID: 32
		// (add) Token: 0x06002BF5 RID: 11253 RVA: 0x0005EE48 File Offset: 0x0005D048
		// (remove) Token: 0x06002BF6 RID: 11254 RVA: 0x0005EE78 File Offset: 0x0005D078
		[Token(Token = "0x14000020")]
		public event EventHandler<ObiClothPicker.ParticlePickEventArgs> OnParticleDragged
		{
			[Token(Token = "0x6002BF5")]
			[Address(RVA = "0x1004F50", Offset = "0x1003D50", VA = "0x181004F50")]
			[CompilerGenerated]
			add
			{
				EventHandler<ObiClothPicker.ParticlePickEventArgs> onParticleDragged = this.OnParticleDragged;
				Delegate @delegate = Delegate.Combine(onParticleDragged, value);
				if (@delegate == 0 || @delegate != 0)
				{
					while (@delegate != onParticleDragged)
					{
					}
					return;
				}
				throw new InvalidCastException();
			}
			[Token(Token = "0x6002BF6")]
			[Address(RVA = "0x10051D0", Offset = "0x1003FD0", VA = "0x1810051D0")]
			[CompilerGenerated]
			remove
			{
				EventHandler<ObiClothPicker.ParticlePickEventArgs> onParticleDragged = this.OnParticleDragged;
				Delegate @delegate = Delegate.Remove(onParticleDragged, value);
				if (@delegate == 0 || @delegate != 0)
				{
					while (@delegate != onParticleDragged)
					{
					}
					return;
				}
				throw new InvalidCastException();
			}
		}

		// Token: 0x14000021 RID: 33
		// (add) Token: 0x06002BF7 RID: 11255 RVA: 0x0005EEA8 File Offset: 0x0005D0A8
		// (remove) Token: 0x06002BF8 RID: 11256 RVA: 0x0005EED8 File Offset: 0x0005D0D8
		[Token(Token = "0x14000021")]
		public event EventHandler<ObiClothPicker.ParticlePickEventArgs> OnParticleReleased
		{
			[Token(Token = "0x6002BF7")]
			[Address(RVA = "0x1005130", Offset = "0x1003F30", VA = "0x181005130")]
			[CompilerGenerated]
			add
			{
				EventHandler<ObiClothPicker.ParticlePickEventArgs> onParticleReleased = this.OnParticleReleased;
				Delegate @delegate = Delegate.Combine(onParticleReleased, value);
				if (@delegate == 0 || @delegate != 0)
				{
					while (@delegate != onParticleReleased)
					{
					}
					return;
				}
				throw new InvalidCastException();
			}
			[Token(Token = "0x6002BF8")]
			[Address(RVA = "0x10053B0", Offset = "0x10041B0", VA = "0x1810053B0")]
			[CompilerGenerated]
			remove
			{
				EventHandler<ObiClothPicker.ParticlePickEventArgs> onParticleReleased = this.OnParticleReleased;
				Delegate @delegate = Delegate.Remove(onParticleReleased, value);
				if (@delegate == 0 || @delegate != 0)
				{
					while (@delegate != onParticleReleased)
					{
					}
					return;
				}
				throw new InvalidCastException();
			}
		}

		// Token: 0x1700030C RID: 780
		// (get) Token: 0x06002BF9 RID: 11257 RVA: 0x0005EF08 File Offset: 0x0005D108
		[Token(Token = "0x1700030C")]
		public ObiClothBase Cloth
		{
			[Token(Token = "0x6002BF9")]
			[Address(RVA = "0x31E390", Offset = "0x31D190", VA = "0x18031E390")]
			get
			{
				return this.cloth;
			}
		}

		// Token: 0x06002BFA RID: 11258 RVA: 0x0005EF1C File Offset: 0x0005D11C
		[Token(Token = "0x6002BFA")]
		[Address(RVA = "0x10042E0", Offset = "0x10030E0", VA = "0x1810042E0")]
		private void Awake()
		{
			ObiClothBase component = base.GetComponent<ObiClothBase>();
			this.cloth = component;
			float z = Input.mousePosition.z;
			this.lastMousePos.z = z;
		}

		// Token: 0x06002BFB RID: 11259 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002BFB")]
		[Address(RVA = "0x1004C50", Offset = "0x1003A50", VA = "0x181004C50")]
		private void OnEnable()
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x06002BFC RID: 11260 RVA: 0x0005EF50 File Offset: 0x0005D150
		[Token(Token = "0x6002BFC")]
		[Address(RVA = "0x1004B60", Offset = "0x1003960", VA = "0x181004B60")]
		private void OnDisable()
		{
			UnityEngine.Object.Destroy(this.meshCollider);
			ObiClothBase obiClothBase = this.cloth;
			int num = 0;
			if (obiClothBase != num)
			{
				ObiSolver solver = this.cloth.solver;
				EventHandler eventHandler = new EventHandler(this.Cloth_Solver_OnFrameBegin);
				solver.OnFrameBegin -= eventHandler;
			}
		}

		// Token: 0x06002BFD RID: 11261 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002BFD")]
		[Address(RVA = "0x1004350", Offset = "0x1003150", VA = "0x181004350")]
		private void Cloth_Solver_OnFrameBegin(object sender, EventArgs e)
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x06002BFE RID: 11262 RVA: 0x0005EFA4 File Offset: 0x0005D1A4
		[Token(Token = "0x6002BFE")]
		[Address(RVA = "0x1004F10", Offset = "0x1003D10", VA = "0x181004F10")]
		public ObiClothPicker()
		{
			float z = Vector3.zero.z;
			this.lastMousePos.z = z;
			this.pickedParticleIndex = (int)((ulong)4294967295L);
			base..ctor();
		}

		// Token: 0x04003462 RID: 13410
		[FieldOffset(Offset = "0x38")]
		[Token(Token = "0x4003462")]
		private MeshCollider meshCollider;

		// Token: 0x04003463 RID: 13411
		[FieldOffset(Offset = "0x40")]
		[Token(Token = "0x4003463")]
		private ObiClothBase cloth;

		// Token: 0x04003464 RID: 13412
		[FieldOffset(Offset = "0x48")]
		[Token(Token = "0x4003464")]
		private Mesh currentCollisionMesh;

		// Token: 0x04003465 RID: 13413
		[FieldOffset(Offset = "0x50")]
		[Token(Token = "0x4003465")]
		private Vector3 lastMousePos;

		// Token: 0x04003466 RID: 13414
		[FieldOffset(Offset = "0x5C")]
		[Token(Token = "0x4003466")]
		private int pickedParticleIndex;

		// Token: 0x04003467 RID: 13415
		[FieldOffset(Offset = "0x60")]
		[Token(Token = "0x4003467")]
		private float pickedParticleDepth;

		// Token: 0x020004E8 RID: 1256
		[Token(Token = "0x20004E8")]
		public class ParticlePickEventArgs : EventArgs
		{
			// Token: 0x06002BFF RID: 11263 RVA: 0x0005EFE0 File Offset: 0x0005D1E0
			[Token(Token = "0x6002BFF")]
			[Address(RVA = "0x69F960", Offset = "0x69E760", VA = "0x18069F960")]
			public ParticlePickEventArgs(int particleIndex, Vector3 mouseDelta)
			{
				float z = mouseDelta.z;
				this.particleIndex = particleIndex;
				this.mouseDelta.z = z;
			}

			// Token: 0x04003468 RID: 13416
			[FieldOffset(Offset = "0x10")]
			[Token(Token = "0x4003468")]
			public int particleIndex;

			// Token: 0x04003469 RID: 13417
			[FieldOffset(Offset = "0x14")]
			[Token(Token = "0x4003469")]
			public Vector3 mouseDelta;
		}
	}
}
