using System;
using System.Collections.Generic;
using Cpp2IlInjected;
using UnityEngine;

namespace Obi
{
	// Token: 0x020004E0 RID: 1248
	[Token(Token = "0x20004E0")]
	[ExecuteInEditMode]
	[RequireComponent(typeof(ObiActor))]
	public class ObiParticleRenderer : MonoBehaviour
	{
		// Token: 0x170002CA RID: 714
		// (get) Token: 0x06002BE1 RID: 11233 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x170002CA")]
		public IEnumerable<Mesh> ParticleMeshes
		{
			[Token(Token = "0x6002BE1")]
			[Address(RVA = "0x33F220", Offset = "0x33E220", VA = "0x18033F220")]
			get
			{
				throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
			}
		}

		// Token: 0x170002CB RID: 715
		// (get) Token: 0x06002BE2 RID: 11234 RVA: 0x0006188C File Offset: 0x0005FA8C
		[Token(Token = "0x170002CB")]
		public Material ParticleMaterial
		{
			[Token(Token = "0x6002BE2")]
			[Address(RVA = "0x33F1F0", Offset = "0x33E1F0", VA = "0x18033F1F0")]
			get
			{
				return this.material;
			}
		}

		// Token: 0x06002BE3 RID: 11235 RVA: 0x000618A0 File Offset: 0x0005FAA0
		[Token(Token = "0x6002BE3")]
		[Address(RVA = "0xE566F0", Offset = "0xE556F0", VA = "0x180E566F0")]
		public void Awake()
		{
			/*
An exception occurred when decompiling this method (06002BE3)

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

 ---> System.Exception: Basic block has to end with unconditional control flow. 
{; 	Block_0:; 	stloc:ObiActor(var_0_06, call:ObiActor(Component::GetComponent, ldloc:ObiParticleRenderer[exp:Component](this))); 	stfld:ObiActor(ObiParticleRenderer::actor, ldloc:ObiParticleRenderer(this), ldloc:ObiActor(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: 0x06002BE4 RID: 11236 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002BE4")]
		[Address(RVA = "0xE56C10", Offset = "0xE55C10", VA = "0x180E56C10")]
		public void OnEnable()
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x06002BE5 RID: 11237 RVA: 0x000618BC File Offset: 0x0005FABC
		[Token(Token = "0x6002BE5")]
		[Address(RVA = "0xE56A80", Offset = "0xE55A80", VA = "0x180E56A80")]
		public void OnDisable()
		{
			ObiActor obiActor = this.actor;
			int num = 0;
			if (obiActor != num)
			{
				ObiSolver solver = this.actor.solver;
				int num2 = 0;
				if (solver != num2)
				{
					ObiActor obiActor2 = this.actor;
					ObiSolver solver2 = obiActor2.solver;
					int renderablePositionsClients = solver2.renderablePositionsClients;
					if (renderablePositionsClients > 0)
					{
						int num3 = renderablePositionsClients - 1;
						solver2.renderablePositionsClients = num3;
						ObiActor obiActor3 = this.actor;
					}
					ObiSolver solver3 = obiActor2.solver;
					EventHandler eventHandler = new EventHandler(this.Actor_solver_OnFrameEnd);
					solver3.OnFrameEnd -= eventHandler;
				}
			}
			this.ClearMeshes();
			UnityEngine.Object.DestroyImmediate(this.material);
		}

		// Token: 0x06002BE6 RID: 11238 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002BE6")]
		[Address(RVA = "0xE55D40", Offset = "0xE54D40", VA = "0x180E55D40")]
		private void Actor_solver_OnFrameEnd(object sender, EventArgs e)
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x06002BE7 RID: 11239 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002BE7")]
		[Address(RVA = "0xE56890", Offset = "0xE55890", VA = "0x180E56890")]
		private void DrawParticles()
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x06002BE8 RID: 11240 RVA: 0x00061964 File Offset: 0x0005FB64
		[Token(Token = "0x6002BE8")]
		[Address(RVA = "0xE56670", Offset = "0xE55670", VA = "0x180E56670")]
		private void Apply(Mesh mesh)
		{
			mesh.Clear();
			List<Vector3> list = this.vertices;
			mesh.SetVertices(list);
			List<Vector3> list2 = this.normals;
			mesh.SetNormals(list2);
			List<Color> list3 = this.colors;
			mesh.SetColors(list3);
			List<int> list4 = this.triangles;
			int num = 0;
			mesh.SetTriangles(list4, num, true);
		}

		// Token: 0x06002BE9 RID: 11241 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002BE9")]
		[Address(RVA = "0xE56740", Offset = "0xE55740", VA = "0x180E56740")]
		private void ClearMeshes()
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x06002BEA RID: 11242 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002BEA")]
		[Address(RVA = "0xE56210", Offset = "0xE55210", VA = "0x180E56210")]
		private void AddParticle(int i, Vector3 position, Color color, float radius)
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x06002BEB RID: 11243 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002BEB")]
		[Address(RVA = "0xE56E20", Offset = "0xE55E20", VA = "0x180E56E20")]
		public ObiParticleRenderer()
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x0400354F RID: 13647
		[FieldOffset(Offset = "0x18")]
		[Token(Token = "0x400354F")]
		public bool render;

		// Token: 0x04003550 RID: 13648
		[FieldOffset(Offset = "0x1C")]
		[Token(Token = "0x4003550")]
		public Color particleColor;

		// Token: 0x04003551 RID: 13649
		[FieldOffset(Offset = "0x2C")]
		[Token(Token = "0x4003551")]
		public float radiusScale;

		// Token: 0x04003552 RID: 13650
		[FieldOffset(Offset = "0x30")]
		[Token(Token = "0x4003552")]
		private ObiActor actor;

		// Token: 0x04003553 RID: 13651
		[FieldOffset(Offset = "0x38")]
		[Token(Token = "0x4003553")]
		private List<Mesh> meshes;

		// Token: 0x04003554 RID: 13652
		[FieldOffset(Offset = "0x40")]
		[Token(Token = "0x4003554")]
		private Material material;

		// Token: 0x04003555 RID: 13653
		[FieldOffset(Offset = "0x48")]
		[Token(Token = "0x4003555")]
		private List<Vector3> vertices;

		// Token: 0x04003556 RID: 13654
		[FieldOffset(Offset = "0x50")]
		[Token(Token = "0x4003556")]
		private List<Vector3> normals;

		// Token: 0x04003557 RID: 13655
		[FieldOffset(Offset = "0x58")]
		[Token(Token = "0x4003557")]
		private List<Color> colors;

		// Token: 0x04003558 RID: 13656
		[FieldOffset(Offset = "0x60")]
		[Token(Token = "0x4003558")]
		private List<int> triangles;

		// Token: 0x04003559 RID: 13657
		[FieldOffset(Offset = "0x68")]
		[Token(Token = "0x4003559")]
		private int particlesPerDrawcall;

		// Token: 0x0400355A RID: 13658
		[FieldOffset(Offset = "0x6C")]
		[Token(Token = "0x400355A")]
		private int drawcallCount;

		// Token: 0x0400355B RID: 13659
		[FieldOffset(Offset = "0x70")]
		[Token(Token = "0x400355B")]
		private Vector3[] particleOffsets;
	}
}
