using System;
using System.Runtime.InteropServices;
using Cpp2IlInjected;
using UnityEngine;

// Token: 0x02000239 RID: 569
[Token(Token = "0x2000239")]
public class Soul : MonoBehaviour
{
	// Token: 0x170000CC RID: 204
	// (get) Token: 0x060015DC RID: 5596 RVA: 0x000318EC File Offset: 0x0002FAEC
	[Token(Token = "0x170000CC")]
	public int CollisionEffectId
	{
		[Token(Token = "0x60015DC")]
		[Address(RVA = "0x75F090", Offset = "0x75E090", VA = "0x18075F090")]
		get
		{
			return this.collisionEffectId;
		}
	}

	// Token: 0x060015DD RID: 5597 RVA: 0x00031900 File Offset: 0x0002FB00
	[Token(Token = "0x60015DD")]
	[Address(RVA = "0x1465110", Offset = "0x1464110", VA = "0x181465110")]
	public void Init()
	{
		ParticleSystem[] componentsInChildren = base.GetComponentsInChildren<ParticleSystem>(true);
		this.soulParticleEffects = componentsInChildren;
		SoundEffect component = base.GetComponent<SoundEffect>();
		this.soulSoundEffect = component;
		ParticleSystem[] array = this.soulParticleEffects;
		if (array != 0 && array.Length > 0)
		{
			array[0].Stop(true);
		}
		SoundEffect soundEffect = this.soulSoundEffect;
		int num = 0;
		if (soundEffect != num)
		{
			this.soulSoundEffect.InitData("SoundEffect");
		}
	}

	// Token: 0x060015DE RID: 5598 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x60015DE")]
	[Address(RVA = "0x1464C00", Offset = "0x1463C00", VA = "0x181464C00")]
	public void InitData(int collisionEffectId, Action<Soul> collisionHandler, float fCloseTime = 2f)
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x060015DF RID: 5599 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x60015DF")]
	[Address(RVA = "0x1464F50", Offset = "0x1463F50", VA = "0x181464F50")]
	public void InitEventData(Vector3 v3Target, int collisionEffectId, Action<Soul> collisionHandler, SwitchDevice SD, [Optional] Transform LeadObject, float fCloseTime = 2f)
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x060015E0 RID: 5600 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x60015E0")]
	[Address(RVA = "0x1464D80", Offset = "0x1463D80", VA = "0x181464D80")]
	public void InitEventData(Vector3 v3Target, int collisionEffectId, Action<Soul> collisionHandler, SceneEvent SE, Transform SEPos, [Optional] Transform LeadObject, float fCloseTime = 2f)
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x060015E1 RID: 5601 RVA: 0x00031978 File Offset: 0x0002FB78
	[Token(Token = "0x60015E1")]
	[Address(RVA = "0x5549C0", Offset = "0x5539C0", VA = "0x1805549C0")]
	public void BindReturnHandlerEvent(Action returnHandler)
	{
		/*
An exception occurred when decompiling this method (060015E1)

ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void Soul::BindReturnHandlerEvent(System.Action)

 ---> System.Exception: Basic block has to end with unconditional control flow. 
{; 	Block_0:; 	stfld:Action(Soul::returnHandler, ldloc:Soul(this), ldloc:Action(returnHandler)); }; 
   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: 0x060015E2 RID: 5602 RVA: 0x0003198C File Offset: 0x0002FB8C
	[Token(Token = "0x60015E2")]
	[Address(RVA = "0x1465420", Offset = "0x1464420", VA = "0x181465420")]
	public void UpdateTimeScale(float timeScale)
	{
		/*
An exception occurred when decompiling this method (060015E2)

ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void Soul::UpdateTimeScale(System.Single)

 ---> System.ArgumentOutOfRangeException: Non-negative number required. (Parameter 'length')
   at System.Array.Copy(Array sourceArray, Int32 sourceIndex, Array destinationArray, Int32 destinationIndex, Int32 length, Boolean reliable)
   at System.Array.Copy(Array sourceArray, Array destinationArray, Int32 length)
   at ICSharpCode.Decompiler.ILAst.ILAstBuilder.StackSlot.ModifyStack(StackSlot[] stack, Int32 popCount, Int32 pushCount, ByteCode pushDefinition) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstBuilder.cs:line 51
   at ICSharpCode.Decompiler.ILAst.ILAstBuilder.StackAnalysis(MethodDef methodDef) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstBuilder.cs:line 401
   at ICSharpCode.Decompiler.ILAst.ILAstBuilder.Build(MethodDef methodDef, Boolean optimize, DecompilerContext context) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstBuilder.cs:line 276
   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 112
   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: 0x060015E3 RID: 5603 RVA: 0x00031A5C File Offset: 0x0002FC5C
	[Token(Token = "0x60015E3")]
	[Address(RVA = "0x4C3B60", Offset = "0x4C2B60", VA = "0x1804C3B60")]
	public bool GetIsColliding()
	{
		return this.isColliding;
	}

	// Token: 0x060015E4 RID: 5604 RVA: 0x00031A70 File Offset: 0x0002FC70
	[Token(Token = "0x60015E4")]
	[Address(RVA = "0x1465230", Offset = "0x1464230", VA = "0x181465230")]
	public void PlaySoulEffect(float timeScale, bool playSoundOnCreated)
	{
		SoundEffect soundEffect = this.soulSoundEffect;
		int num = 0;
		bool flag = soundEffect != num;
		if (playSoundOnCreated != flag)
		{
			this.soulSoundEffect.PlayRandom(1f, 1f);
		}
		ParticleSystem[] array = this.soulParticleEffects;
		if (array != 0 && array.Length > 0)
		{
			if (array[0].isPlaying)
			{
				this.soulParticleEffects[0].Stop(true);
			}
			this.soulParticleEffects[0].Play(true);
		}
		this.UpdateTimeScale(timeScale);
	}

	// Token: 0x060015E5 RID: 5605 RVA: 0x00031AFC File Offset: 0x0002FCFC
	[Token(Token = "0x60015E5")]
	[Address(RVA = "0x1465400", Offset = "0x1464400", VA = "0x181465400")]
	public void SetAliveTime(float visibleTime, float aliveTime)
	{
		this.visibleTime = visibleTime;
		this.aliveTime = visibleTime;
	}

	// Token: 0x060015E6 RID: 5606 RVA: 0x00031B18 File Offset: 0x0002FD18
	[Token(Token = "0x60015E6")]
	[Address(RVA = "0x1464AD0", Offset = "0x1463AD0", VA = "0x181464AD0")]
	private void CheckLifeTime()
	{
		float num = this.aliveTime;
		if (0 < (int)num)
		{
			this.aliveTime = num;
			if (this.soulSoundEffect)
			{
				this.soulSoundEffect.Stop();
			}
			this.ReturnItem();
			return;
		}
	}

	// Token: 0x060015E7 RID: 5607 RVA: 0x00031B60 File Offset: 0x0002FD60
	[Token(Token = "0x60015E7")]
	[Address(RVA = "0x1464B90", Offset = "0x1463B90", VA = "0x181464B90")]
	private void CheckVisibleTime()
	{
		float num = this.visibleTime;
		if (0 < (int)num)
		{
			this.visibleTime = num;
			ParticleSystem[] array = this.soulParticleEffects;
			if (array != 0)
			{
				array[0].Stop(true);
				return;
			}
		}
	}

	// Token: 0x060015E8 RID: 5608 RVA: 0x00031BA0 File Offset: 0x0002FDA0
	[Token(Token = "0x60015E8")]
	[Address(RVA = "0x1465380", Offset = "0x1464380", VA = "0x181465380")]
	private void ReturnItem()
	{
		ParticleSystem[] array = this.soulParticleEffects;
		if (array != 0)
		{
			array[0].Stop();
		}
		GameObject gameObject = base.gameObject;
		int num = 0;
		gameObject.SetActive(num != 0);
		Action action = this.returnHandler;
		if (action != 0)
		{
			action();
			return;
		}
	}

	// Token: 0x060015E9 RID: 5609 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x60015E9")]
	[Address(RVA = "0x1465610", Offset = "0x1464610", VA = "0x181465610")]
	private void Update()
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x060015EA RID: 5610 RVA: 0x00031BEC File Offset: 0x0002FDEC
	[Token(Token = "0x60015EA")]
	[Address(RVA = "0x14662C0", Offset = "0x14652C0", VA = "0x1814662C0")]
	public Soul()
	{
	}

	// Token: 0x0400211B RID: 8475
	[Cpp2IlInjected.FieldOffset(Offset = "0x18")]
	[Token(Token = "0x400211B")]
	public SoulSystem.SoulType SoulType;

	// Token: 0x0400211C RID: 8476
	[Cpp2IlInjected.FieldOffset(Offset = "0x1C")]
	[Token(Token = "0x400211C")]
	public float Quality = 1f;

	// Token: 0x0400211D RID: 8477
	[Cpp2IlInjected.FieldOffset(Offset = "0x20")]
	[Token(Token = "0x400211D")]
	private float g_fPiX;

	// Token: 0x0400211E RID: 8478
	[Cpp2IlInjected.FieldOffset(Offset = "0x24")]
	[Token(Token = "0x400211E")]
	private float g_fPiY;

	// Token: 0x0400211F RID: 8479
	[Cpp2IlInjected.FieldOffset(Offset = "0x28")]
	[Token(Token = "0x400211F")]
	private float g_fPiZ;

	// Token: 0x04002120 RID: 8480
	[Cpp2IlInjected.FieldOffset(Offset = "0x2C")]
	[Token(Token = "0x4002120")]
	private float g_fSpeedX;

	// Token: 0x04002121 RID: 8481
	[Cpp2IlInjected.FieldOffset(Offset = "0x30")]
	[Token(Token = "0x4002121")]
	private float g_fSpeedY;

	// Token: 0x04002122 RID: 8482
	[Cpp2IlInjected.FieldOffset(Offset = "0x34")]
	[Token(Token = "0x4002122")]
	private float g_fSpeedZ;

	// Token: 0x04002123 RID: 8483
	[Cpp2IlInjected.FieldOffset(Offset = "0x38")]
	[Token(Token = "0x4002123")]
	private Vector3 g_v3CreateMoveDir;

	// Token: 0x04002124 RID: 8484
	[Cpp2IlInjected.FieldOffset(Offset = "0x44")]
	[Token(Token = "0x4002124")]
	private float g_fCreateMoveSpeedVal;

	// Token: 0x04002125 RID: 8485
	[Token(Token = "0x4002125")]
	private const float g_fCreateMoveSpeed = 2f;

	// Token: 0x04002126 RID: 8486
	[Cpp2IlInjected.FieldOffset(Offset = "0x48")]
	[Token(Token = "0x4002126")]
	private float g_fFollowSpeed;

	// Token: 0x04002127 RID: 8487
	[Token(Token = "0x4002127")]
	private const float g_fFollowSpeedMax = 50f;

	// Token: 0x04002128 RID: 8488
	[Cpp2IlInjected.FieldOffset(Offset = "0x4C")]
	[Token(Token = "0x4002128")]
	private float g_fFreeTimeVal;

	// Token: 0x04002129 RID: 8489
	[Token(Token = "0x4002129")]
	private const float g_fFreeTime = 2f;

	// Token: 0x0400212A RID: 8490
	[Token(Token = "0x400212A")]
	private const float g_fPI2 = 6.2831855f;

	// Token: 0x0400212B RID: 8491
	[Token(Token = "0x400212B")]
	private const float g_fSpeedMin = 0.5f;

	// Token: 0x0400212C RID: 8492
	[Token(Token = "0x400212C")]
	private const float g_fSpeedMax = 2f;

	// Token: 0x0400212D RID: 8493
	[Cpp2IlInjected.FieldOffset(Offset = "0x50")]
	[Token(Token = "0x400212D")]
	private Vector3 g_PrePosition;

	// Token: 0x0400212E RID: 8494
	[Cpp2IlInjected.FieldOffset(Offset = "0x5C")]
	[Token(Token = "0x400212E")]
	private bool isColliding;

	// Token: 0x0400212F RID: 8495
	[Cpp2IlInjected.FieldOffset(Offset = "0x60")]
	[Token(Token = "0x400212F")]
	private int collisionEffectId;

	// Token: 0x04002130 RID: 8496
	[Cpp2IlInjected.FieldOffset(Offset = "0x68")]
	[Token(Token = "0x4002130")]
	private Action<Soul> collisionHandler;

	// Token: 0x04002131 RID: 8497
	[Cpp2IlInjected.FieldOffset(Offset = "0x70")]
	[Token(Token = "0x4002131")]
	private Action returnHandler;

	// Token: 0x04002132 RID: 8498
	[Cpp2IlInjected.FieldOffset(Offset = "0x78")]
	[Token(Token = "0x4002132")]
	private float g_fCloseTime;

	// Token: 0x04002133 RID: 8499
	[Cpp2IlInjected.FieldOffset(Offset = "0x7C")]
	[Token(Token = "0x4002133")]
	private float visibleTime;

	// Token: 0x04002134 RID: 8500
	[Cpp2IlInjected.FieldOffset(Offset = "0x80")]
	[Token(Token = "0x4002134")]
	private float aliveTime;

	// Token: 0x04002135 RID: 8501
	[Cpp2IlInjected.FieldOffset(Offset = "0x84")]
	[Token(Token = "0x4002135")]
	private Vector3 g_v3Target;

	// Token: 0x04002136 RID: 8502
	[Cpp2IlInjected.FieldOffset(Offset = "0x90")]
	[Token(Token = "0x4002136")]
	private SwitchDevice g_SD;

	// Token: 0x04002137 RID: 8503
	[Cpp2IlInjected.FieldOffset(Offset = "0x98")]
	[Token(Token = "0x4002137")]
	private SceneEvent g_OpenSceneEvent;

	// Token: 0x04002138 RID: 8504
	[Cpp2IlInjected.FieldOffset(Offset = "0xA0")]
	[Token(Token = "0x4002138")]
	private Transform g_OpenSceneEventPos;

	// Token: 0x04002139 RID: 8505
	[Cpp2IlInjected.FieldOffset(Offset = "0xA8")]
	[Token(Token = "0x4002139")]
	private Transform g_LeadObject;

	// Token: 0x0400213A RID: 8506
	[Cpp2IlInjected.FieldOffset(Offset = "0xB0")]
	[Token(Token = "0x400213A")]
	private float deltaTime;

	// Token: 0x0400213B RID: 8507
	[Cpp2IlInjected.FieldOffset(Offset = "0xB4")]
	[Token(Token = "0x400213B")]
	private bool tracePlayer;

	// Token: 0x0400213C RID: 8508
	[Cpp2IlInjected.FieldOffset(Offset = "0xB8")]
	[Token(Token = "0x400213C")]
	private ParticleSystem[] soulParticleEffects;

	// Token: 0x0400213D RID: 8509
	[Cpp2IlInjected.FieldOffset(Offset = "0xC0")]
	[Token(Token = "0x400213D")]
	private SoundEffect soulSoundEffect;
}
