using System;
using Cpp2IlInjected;
using MarsSDK;
using UnityEngine;

// Token: 0x0200011B RID: 283
[Token(Token = "0x200011B")]
public class EffectPool : IDisposable
{
	// Token: 0x06000F09 RID: 3849 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x6000F09")]
	[Address(RVA = "0x159D110", Offset = "0x159C110", VA = "0x18159D110")]
	public void Init(string assetPath, Transform root, int limitation, float aliveTime = 1f, float recycleTime = 3f)
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x06000F0A RID: 3850 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x6000F0A")]
	[Address(RVA = "0x159CDB0", Offset = "0x159BDB0", VA = "0x18159CDB0")]
	public void Init(GameObject prefab, Transform root, int limitation, float aliveTime = 1f, float recycleTime = 3f)
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x06000F0B RID: 3851 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x6000F0B")]
	[Address(RVA = "0x159CE20", Offset = "0x159BE20", VA = "0x18159CE20")]
	private void Init(int limitation, float aliveTime, float recycleTime)
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x06000F0C RID: 3852 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x6000F0C")]
	[Address(RVA = "0x159D5C0", Offset = "0x159C5C0", VA = "0x18159D5C0")]
	private void RegisterEffectUpdaterProcessor()
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x06000F0D RID: 3853 RVA: 0x0002348C File Offset: 0x0002168C
	[Token(Token = "0x6000F0D")]
	[Address(RVA = "0x159D350", Offset = "0x159C350", VA = "0x18159D350")]
	private bool IsReady()
	{
		GameObject gameObject = this.prefab;
		int num = 0;
		return gameObject != num;
	}

	// Token: 0x06000F0E RID: 3854 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x6000F0E")]
	[Address(RVA = "0x159D3B0", Offset = "0x159C3B0", VA = "0x18159D3B0")]
	public GameObject NewUse(Vector3 position, Quaternion rotation, bool withSound = true)
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x06000F0F RID: 3855 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x6000F0F")]
	[Address(RVA = "0x159D500", Offset = "0x159C500", VA = "0x18159D500")]
	public GameObject NewUse(bool withSound = true)
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x06000F10 RID: 3856 RVA: 0x000234AC File Offset: 0x000216AC
	[Token(Token = "0x6000F10")]
	[Address(RVA = "0x159D7E0", Offset = "0x159C7E0", VA = "0x18159D7E0")]
	public void SetTimeScale(float timeScale)
	{
		ObjectPoolLimited<EffectUpdater> objectPoolLimited = this.updaterPool;
		this.timeScale = timeScale;
		if (objectPoolLimited != 0)
		{
			Action<EffectUpdater> action = this.effectUpdaterTimeScaleProcessor;
			objectPoolLimited.ProcessActivePool(action);
		}
	}

	// Token: 0x06000F11 RID: 3857 RVA: 0x000234DC File Offset: 0x000216DC
	[Token(Token = "0x6000F11")]
	[Address(RVA = "0x159D900", Offset = "0x159C900", VA = "0x18159D900")]
	public void Stop(float recycleTime)
	{
		if (!this.hasDisposed)
		{
			GameObject gameObject = this.prefab;
			int num = 0;
			if (gameObject != num)
			{
				EffectUpdater effectUpdater = this.lastActiveUpdater;
				if (effectUpdater != 0)
				{
					effectUpdater.StopEffect(recycleTime);
				}
			}
		}
	}

	// Token: 0x06000F12 RID: 3858 RVA: 0x00023518 File Offset: 0x00021718
	[Token(Token = "0x6000F12")]
	[Address(RVA = "0x159D840", Offset = "0x159C840", VA = "0x18159D840")]
	public void StopAll(float recycleTime)
	{
		if (!this.hasDisposed)
		{
			GameObject gameObject = this.prefab;
			int num = 0;
			if (gameObject != num)
			{
				ObjectPoolLimited<EffectUpdater> objectPoolLimited = this.updaterPool;
				this.recycleTime = recycleTime;
				Action<EffectUpdater> action = this.effectUpdaterStopProcessor;
				objectPoolLimited.ProcessActivePool(action);
			}
		}
	}

	// Token: 0x06000F13 RID: 3859 RVA: 0x00023564 File Offset: 0x00021764
	[Token(Token = "0x6000F13")]
	[Address(RVA = "0x159C880", Offset = "0x159B880", VA = "0x18159C880")]
	public void CloseAll()
	{
		if (!this.hasDisposed)
		{
			GameObject gameObject = this.prefab;
			int num = 0;
			if (gameObject != num)
			{
				ObjectPoolLimited<EffectUpdater> objectPoolLimited = this.updaterPool;
				Action<EffectUpdater> action = this.effectUpdaterDisposeProcessor;
				objectPoolLimited.ProcessActivePool(action);
				this.updaterPool.ReturnAll();
				return;
			}
		}
	}

	// Token: 0x06000F14 RID: 3860 RVA: 0x000235B4 File Offset: 0x000217B4
	[Token(Token = "0x6000F14")]
	[Address(RVA = "0x159BEE0", Offset = "0x159AEE0", VA = "0x18159BEE0")]
	public Transform GetSource()
	{
		return this.prefab.transform;
	}

	// Token: 0x06000F15 RID: 3861 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x6000F15")]
	[Address(RVA = "0x159CC40", Offset = "0x159BC40", VA = "0x18159CC40")]
	public GameObject GetGameObject()
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x06000F16 RID: 3862 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x6000F16")]
	[Address(RVA = "0x159CAD0", Offset = "0x159BAD0", VA = "0x18159CAD0")]
	public GameObject[] GetAllGameObjects()
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x06000F17 RID: 3863 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x6000F17")]
	[Address(RVA = "0x159CC50", Offset = "0x159BC50", VA = "0x18159CC50")]
	public ParticleSystem GetParticle()
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x06000F18 RID: 3864 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x6000F18")]
	[Address(RVA = "0x159CC90", Offset = "0x159BC90", VA = "0x18159CC90")]
	public SoundEffect GetSoundEffect()
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x06000F19 RID: 3865 RVA: 0x000235D4 File Offset: 0x000217D4
	[Token(Token = "0x6000F19")]
	[Address(RVA = "0x159BC70", Offset = "0x159AC70", VA = "0x18159BC70")]
	public float GetAliveTime()
	{
		return this.data.aliveTime;
	}

	// Token: 0x06000F1A RID: 3866 RVA: 0x000235F4 File Offset: 0x000217F4
	[Token(Token = "0x6000F1A")]
	[Address(RVA = "0x159C970", Offset = "0x159B970", VA = "0x18159C970", Slot = "4")]
	public void Dispose()
	{
		this.hasDisposed = true;
		ObjectPoolLimited<EffectUpdater> objectPoolLimited = this.updaterPool;
		Action<EffectUpdater> action = this.effectUpdaterDisposeProcessor;
		objectPoolLimited.ProcessActivePool(action);
		this.updaterPool.Dispose();
	}

	// Token: 0x06000F1B RID: 3867 RVA: 0x00023630 File Offset: 0x00021830
	[Token(Token = "0x6000F1B")]
	[Address(RVA = "0x159CA20", Offset = "0x159BA20", VA = "0x18159CA20")]
	private EffectUpdater GenerateUpdater()
	{
		GameObject gameObject = this.prefab;
		Transform transform = this.root;
		return new EffectUpdater(UnityEngine.Object.Instantiate<GameObject>(gameObject, transform));
	}

	// Token: 0x06000F1C RID: 3868 RVA: 0x00023658 File Offset: 0x00021858
	[Token(Token = "0x6000F1C")]
	[Address(RVA = "0x159CCA0", Offset = "0x159BCA0", VA = "0x18159CCA0")]
	private EffectUpdater GetUpdater()
	{
		EffectUpdater effectUpdater = this.updaterPool.Get();
		EffectControlData effectControlData = this.data;
		float num = effectControlData.recycleTime;
		float aliveTime = effectControlData.aliveTime;
		effectUpdater.recycleTime = num;
		effectUpdater.aliveTime = aliveTime;
		Action<EffectUpdater> action = new Action(this.ReturnUpdater);
		effectUpdater.recycleHandler = action;
		float num2 = this.timeScale;
		effectUpdater.timeScale = num2;
		effectUpdater.UpdateTimeScale();
		this.lastActiveUpdater = effectUpdater;
		return this.lastActiveUpdater;
	}

	// Token: 0x06000F1D RID: 3869 RVA: 0x000236D4 File Offset: 0x000218D4
	[Token(Token = "0x6000F1D")]
	[Address(RVA = "0x159D760", Offset = "0x159C760", VA = "0x18159D760")]
	private void ReturnUpdater(EffectUpdater updater)
	{
		updater.Dispose();
		this.updaterPool.Return(updater);
		if (updater == this.lastActiveUpdater)
		{
		}
	}

	// Token: 0x06000F1E RID: 3870 RVA: 0x00023704 File Offset: 0x00021904
	[Token(Token = "0x6000F1E")]
	[Address(RVA = "0x159D9F0", Offset = "0x159C9F0", VA = "0x18159D9F0")]
	public EffectPool()
	{
	}

	// Token: 0x0400199E RID: 6558
	[FieldOffset(Offset = "0x10")]
	[Token(Token = "0x400199E")]
	private GameObject prefab;

	// Token: 0x0400199F RID: 6559
	[FieldOffset(Offset = "0x18")]
	[Token(Token = "0x400199F")]
	private Transform root;

	// Token: 0x040019A0 RID: 6560
	[FieldOffset(Offset = "0x20")]
	[Token(Token = "0x40019A0")]
	private EffectControlData data;

	// Token: 0x040019A1 RID: 6561
	[FieldOffset(Offset = "0x28")]
	[Token(Token = "0x40019A1")]
	private float timeScale = 1f;

	// Token: 0x040019A2 RID: 6562
	[FieldOffset(Offset = "0x2C")]
	[Token(Token = "0x40019A2")]
	private float recycleTime;

	// Token: 0x040019A3 RID: 6563
	[FieldOffset(Offset = "0x30")]
	[Token(Token = "0x40019A3")]
	private ObjectPoolLimited<EffectUpdater> updaterPool;

	// Token: 0x040019A4 RID: 6564
	[FieldOffset(Offset = "0x38")]
	[Token(Token = "0x40019A4")]
	private EffectUpdater lastActiveUpdater;

	// Token: 0x040019A5 RID: 6565
	[FieldOffset(Offset = "0x40")]
	[Token(Token = "0x40019A5")]
	private Action<EffectUpdater> effectUpdaterTimeScaleProcessor;

	// Token: 0x040019A6 RID: 6566
	[FieldOffset(Offset = "0x48")]
	[Token(Token = "0x40019A6")]
	private Action<EffectUpdater> effectUpdaterStopProcessor;

	// Token: 0x040019A7 RID: 6567
	[FieldOffset(Offset = "0x50")]
	[Token(Token = "0x40019A7")]
	private Action<EffectUpdater> effectUpdaterDisposeProcessor;

	// Token: 0x040019A8 RID: 6568
	[FieldOffset(Offset = "0x58")]
	[Token(Token = "0x40019A8")]
	private bool hasDisposed;
}
