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

// Token: 0x020003B4 RID: 948
[Token(Token = "0x20003B4")]
[RequireComponent(typeof(ObiCloth))]
public class RuntimeClothGenerator : MonoBehaviour
{
	// Token: 0x1400000B RID: 11
	// (add) Token: 0x060023E4 RID: 9188 RVA: 0x00055C08 File Offset: 0x00053E08
	// (remove) Token: 0x060023E5 RID: 9189 RVA: 0x00055C38 File Offset: 0x00053E38
	[Token(Token = "0x1400000B")]
	public event EventHandler Done
	{
		[Token(Token = "0x60023E4")]
		[Address(RVA = "0x509B30", Offset = "0x508B30", VA = "0x180509B30")]
		[CompilerGenerated]
		add
		{
			EventHandler done = this.Done;
			Delegate @delegate = Delegate.Combine(done, value);
			if (@delegate == 0 || @delegate != 0)
			{
				while (@delegate != done)
				{
				}
				return;
			}
			throw new InvalidCastException();
		}
		[Token(Token = "0x60023E5")]
		[Address(RVA = "0x509BD0", Offset = "0x508BD0", VA = "0x180509BD0")]
		[CompilerGenerated]
		remove
		{
			EventHandler done = this.Done;
			Delegate @delegate = Delegate.Remove(done, value);
			if (@delegate == 0 || @delegate != 0)
			{
				while (@delegate != done)
				{
				}
				return;
			}
			throw new InvalidCastException();
		}
	}

	// Token: 0x170001F6 RID: 502
	// (get) Token: 0x060023E6 RID: 9190 RVA: 0x00055C68 File Offset: 0x00053E68
	[Token(Token = "0x170001F6")]
	public ObiCloth Cloth
	{
		[Token(Token = "0x60023E6")]
		[Address(RVA = "0x33F220", Offset = "0x33E220", VA = "0x18033F220")]
		get
		{
			return this.cloth;
		}
	}

	// Token: 0x060023E7 RID: 9191 RVA: 0x00055C7C File Offset: 0x00053E7C
	[Token(Token = "0x60023E7")]
	[Address(RVA = "0x509A00", Offset = "0x508A00", VA = "0x180509A00")]
	public void Awake()
	{
		/*
An exception occurred when decompiling this method (060023E7)

ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void RuntimeClothGenerator::Awake()

 ---> System.Exception: Basic block has to end with unconditional control flow. 
{; 	Block_0:; 	stloc:ObiCloth(var_0_06, call:ObiCloth(Component::GetComponent, ldloc:RuntimeClothGenerator[exp:Component](this))); 	stfld:ObiCloth(RuntimeClothGenerator::cloth, ldloc:RuntimeClothGenerator(this), ldloc:ObiCloth(var_0_06)); }; 
   at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1810
   at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.Optimize(DecompilerContext context, ILBlock method, AutoPropertyProvider autoPropertyProvider, StateMachineKind& stateMachineKind, MethodDef& inlinedMethod, AsyncMethodDebugInfo& asyncInfo, ILAstOptimizationStep abortBeforeStep) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 344
   at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(IEnumerable`1 parameters, MethodDebugInfoBuilder& builder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 123
   at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 88
   --- End of inner exception stack trace ---
   at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 92
   at ICSharpCode.Decompiler.Ast.AstBuilder.AddMethodBody(EntityDeclaration methodNode, EntityDeclaration& updatedNode, MethodDef method, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, MethodKind methodKind) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstBuilder.cs:line 1618
*/;
	}

	// Token: 0x060023E8 RID: 9192 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x60023E8")]
	[Address(RVA = "0x509AC0", Offset = "0x508AC0", VA = "0x180509AC0")]
	public IEnumerator Start()
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x060023E9 RID: 9193 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x60023E9")]
	[Address(RVA = "0x509A50", Offset = "0x508A50", VA = "0x180509A50")]
	private IEnumerator GenerateAndAddToSolver()
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x060023EA RID: 9194 RVA: 0x00055C98 File Offset: 0x00053E98
	[Token(Token = "0x60023EA")]
	[Address(RVA = "0x328C40", Offset = "0x327C40", VA = "0x180328C40")]
	public RuntimeClothGenerator()
	{
	}

	// Token: 0x04002D6A RID: 11626
	[FieldOffset(Offset = "0x18")]
	[Token(Token = "0x4002D6A")]
	public ObiSolver solver;

	// Token: 0x04002D6B RID: 11627
	[FieldOffset(Offset = "0x20")]
	[Token(Token = "0x4002D6B")]
	public Mesh mesh;

	// Token: 0x04002D6C RID: 11628
	[FieldOffset(Offset = "0x28")]
	[Token(Token = "0x4002D6C")]
	public ObiMeshTopology topology;

	// Token: 0x04002D6E RID: 11630
	[FieldOffset(Offset = "0x38")]
	[Token(Token = "0x4002D6E")]
	private ObiCloth cloth;
}
