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

// Token: 0x0200035C RID: 860
[Token(Token = "0x200035C")]
[RequireComponent(typeof(ObiCloth))]
public class RuntimeClothGenerator : MonoBehaviour
{
	// Token: 0x1400000B RID: 11
	// (add) Token: 0x0600211B RID: 8475 RVA: 0x0004E96C File Offset: 0x0004CB6C
	// (remove) Token: 0x0600211C RID: 8476 RVA: 0x0004E99C File Offset: 0x0004CB9C
	[Token(Token = "0x1400000B")]
	public event EventHandler Done
	{
		[Token(Token = "0x600211B")]
		[Address(RVA = "0x42F7B0", Offset = "0x42E5B0", VA = "0x18042F7B0")]
		[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 = "0x600211C")]
		[Address(RVA = "0x42F850", Offset = "0x42E650", VA = "0x18042F850")]
		[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: 0x170001D1 RID: 465
	// (get) Token: 0x0600211D RID: 8477 RVA: 0x0004E9CC File Offset: 0x0004CBCC
	[Token(Token = "0x170001D1")]
	public ObiCloth Cloth
	{
		[Token(Token = "0x600211D")]
		[Address(RVA = "0x31E3C0", Offset = "0x31D1C0", VA = "0x18031E3C0")]
		get
		{
			return this.cloth;
		}
	}

	// Token: 0x0600211E RID: 8478 RVA: 0x0004E9E0 File Offset: 0x0004CBE0
	[Token(Token = "0x600211E")]
	[Address(RVA = "0x42F680", Offset = "0x42E480", VA = "0x18042F680")]
	public void Awake()
	{
		/*
An exception occurred when decompiling this method (0600211E)

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: 0x0600211F RID: 8479 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x600211F")]
	[Address(RVA = "0x42F740", Offset = "0x42E540", VA = "0x18042F740")]
	public IEnumerator Start()
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x06002120 RID: 8480 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x6002120")]
	[Address(RVA = "0x42F6D0", Offset = "0x42E4D0", VA = "0x18042F6D0")]
	private IEnumerator GenerateAndAddToSolver()
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x06002121 RID: 8481 RVA: 0x0004E9FC File Offset: 0x0004CBFC
	[Token(Token = "0x6002121")]
	[Address(RVA = "0x3088F0", Offset = "0x3076F0", VA = "0x1803088F0")]
	public RuntimeClothGenerator()
	{
	}

	// Token: 0x04002A80 RID: 10880
	[FieldOffset(Offset = "0x18")]
	[Token(Token = "0x4002A80")]
	public ObiSolver solver;

	// Token: 0x04002A81 RID: 10881
	[FieldOffset(Offset = "0x20")]
	[Token(Token = "0x4002A81")]
	public Mesh mesh;

	// Token: 0x04002A82 RID: 10882
	[FieldOffset(Offset = "0x28")]
	[Token(Token = "0x4002A82")]
	public ObiMeshTopology topology;

	// Token: 0x04002A84 RID: 10884
	[FieldOffset(Offset = "0x38")]
	[Token(Token = "0x4002A84")]
	private ObiCloth cloth;
}
