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

namespace Obi
{
	// Token: 0x0200053F RID: 1343
	[Token(Token = "0x200053F")]
	public class ObiClothPicker : MonoBehaviour
	{
		// Token: 0x1400001E RID: 30
		// (add) Token: 0x06002EBA RID: 11962 RVA: 0x0006601C File Offset: 0x0006421C
		// (remove) Token: 0x06002EBB RID: 11963 RVA: 0x0006604C File Offset: 0x0006424C
		[Token(Token = "0x1400001E")]
		public event EventHandler<ObiClothPicker.ParticlePickEventArgs> OnParticlePicked
		{
			[Token(Token = "0x6002EBA")]
			[Address(RVA = "0x10983C0", Offset = "0x10973C0", VA = "0x1810983C0")]
			[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 = "0x6002EBB")]
			[Address(RVA = "0x1098640", Offset = "0x1097640", VA = "0x181098640")]
			[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: 0x06002EBC RID: 11964 RVA: 0x0006607C File Offset: 0x0006427C
		// (remove) Token: 0x06002EBD RID: 11965 RVA: 0x000660AC File Offset: 0x000642AC
		[Token(Token = "0x1400001F")]
		public event EventHandler<ObiClothPicker.ParticlePickEventArgs> OnParticleHeld
		{
			[Token(Token = "0x6002EBC")]
			[Address(RVA = "0x1098320", Offset = "0x1097320", VA = "0x181098320")]
			[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 = "0x6002EBD")]
			[Address(RVA = "0x10985A0", Offset = "0x10975A0", VA = "0x1810985A0")]
			[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: 0x06002EBE RID: 11966 RVA: 0x000660DC File Offset: 0x000642DC
		// (remove) Token: 0x06002EBF RID: 11967 RVA: 0x0006610C File Offset: 0x0006430C
		[Token(Token = "0x14000020")]
		public event EventHandler<ObiClothPicker.ParticlePickEventArgs> OnParticleDragged
		{
			[Token(Token = "0x6002EBE")]
			[Address(RVA = "0x1098280", Offset = "0x1097280", VA = "0x181098280")]
			[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 = "0x6002EBF")]
			[Address(RVA = "0x1098500", Offset = "0x1097500", VA = "0x181098500")]
			[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: 0x06002EC0 RID: 11968 RVA: 0x0006613C File Offset: 0x0006433C
		// (remove) Token: 0x06002EC1 RID: 11969 RVA: 0x0006616C File Offset: 0x0006436C
		[Token(Token = "0x14000021")]
		public event EventHandler<ObiClothPicker.ParticlePickEventArgs> OnParticleReleased
		{
			[Token(Token = "0x6002EC0")]
			[Address(RVA = "0x1098460", Offset = "0x1097460", VA = "0x181098460")]
			[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 = "0x6002EC1")]
			[Address(RVA = "0x10986E0", Offset = "0x10976E0", VA = "0x1810986E0")]
			[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: 0x17000331 RID: 817
		// (get) Token: 0x06002EC2 RID: 11970 RVA: 0x0006619C File Offset: 0x0006439C
		[Token(Token = "0x17000331")]
		public ObiClothBase Cloth
		{
			[Token(Token = "0x6002EC2")]
			[Address(RVA = "0x33F1F0", Offset = "0x33E1F0", VA = "0x18033F1F0")]
			get
			{
				return this.cloth;
			}
		}

		// Token: 0x06002EC3 RID: 11971 RVA: 0x000661B0 File Offset: 0x000643B0
		[Token(Token = "0x6002EC3")]
		[Address(RVA = "0x1097610", Offset = "0x1096610", VA = "0x181097610")]
		private void Awake()
		{
			ObiClothBase component = base.GetComponent<ObiClothBase>();
			this.cloth = component;
			float z = Input.mousePosition.z;
			this.lastMousePos.z = z;
		}

		// Token: 0x06002EC4 RID: 11972 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002EC4")]
		[Address(RVA = "0x1097F80", Offset = "0x1096F80", VA = "0x181097F80")]
		private void OnEnable()
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x06002EC5 RID: 11973 RVA: 0x000661E4 File Offset: 0x000643E4
		[Token(Token = "0x6002EC5")]
		[Address(RVA = "0x1097E90", Offset = "0x1096E90", VA = "0x181097E90")]
		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: 0x06002EC6 RID: 11974 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002EC6")]
		[Address(RVA = "0x1097680", Offset = "0x1096680", VA = "0x181097680")]
		private void Cloth_Solver_OnFrameBegin(object sender, EventArgs e)
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x06002EC7 RID: 11975 RVA: 0x00066238 File Offset: 0x00064438
		[Token(Token = "0x6002EC7")]
		[Address(RVA = "0x1098240", Offset = "0x1097240", VA = "0x181098240")]
		public ObiClothPicker()
		{
			float z = Vector3.zero.z;
			this.lastMousePos.z = z;
			this.pickedParticleIndex = (int)((ulong)4294967295L);
			base..ctor();
		}

		// Token: 0x0400374C RID: 14156
		[FieldOffset(Offset = "0x38")]
		[Token(Token = "0x400374C")]
		private MeshCollider meshCollider;

		// Token: 0x0400374D RID: 14157
		[FieldOffset(Offset = "0x40")]
		[Token(Token = "0x400374D")]
		private ObiClothBase cloth;

		// Token: 0x0400374E RID: 14158
		[FieldOffset(Offset = "0x48")]
		[Token(Token = "0x400374E")]
		private Mesh currentCollisionMesh;

		// Token: 0x0400374F RID: 14159
		[FieldOffset(Offset = "0x50")]
		[Token(Token = "0x400374F")]
		private Vector3 lastMousePos;

		// Token: 0x04003750 RID: 14160
		[FieldOffset(Offset = "0x5C")]
		[Token(Token = "0x4003750")]
		private int pickedParticleIndex;

		// Token: 0x04003751 RID: 14161
		[FieldOffset(Offset = "0x60")]
		[Token(Token = "0x4003751")]
		private float pickedParticleDepth;

		// Token: 0x02000540 RID: 1344
		[Token(Token = "0x2000540")]
		public class ParticlePickEventArgs : EventArgs
		{
			// Token: 0x06002EC8 RID: 11976 RVA: 0x00066274 File Offset: 0x00064474
			[Token(Token = "0x6002EC8")]
			[Address(RVA = "0x69A440", Offset = "0x699440", VA = "0x18069A440")]
			public ParticlePickEventArgs(int particleIndex, Vector3 mouseDelta)
			{
				float z = mouseDelta.z;
				this.particleIndex = particleIndex;
				this.mouseDelta.z = z;
			}

			// Token: 0x04003752 RID: 14162
			[FieldOffset(Offset = "0x10")]
			[Token(Token = "0x4003752")]
			public int particleIndex;

			// Token: 0x04003753 RID: 14163
			[FieldOffset(Offset = "0x14")]
			[Token(Token = "0x4003753")]
			public Vector3 mouseDelta;
		}
	}
}
