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

// Token: 0x020000F5 RID: 245
[Token(Token = "0x20000F5")]
public class EffectPool : IDisposable
{
	// Token: 0x06000DDE RID: 3550 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x6000DDE")]
	[Address(RVA = "0xA608E0", Offset = "0xA5F6E0", VA = "0x180A608E0")]
	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: 0x06000DDF RID: 3551 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x6000DDF")]
	[Address(RVA = "0xA60580", Offset = "0xA5F380", VA = "0x180A60580")]
	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: 0x06000DE0 RID: 3552 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x6000DE0")]
	[Address(RVA = "0xA605F0", Offset = "0xA5F3F0", VA = "0x180A605F0")]
	private void Init(int limitation, float aliveTime, float recycleTime)
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x06000DE1 RID: 3553 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x6000DE1")]
	[Address(RVA = "0xA60D90", Offset = "0xA5FB90", VA = "0x180A60D90")]
	private void RegisterEffectUpdaterProcessor()
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x06000DE2 RID: 3554 RVA: 0x0002154C File Offset: 0x0001F74C
	[Token(Token = "0x6000DE2")]
	[Address(RVA = "0xA60B20", Offset = "0xA5F920", VA = "0x180A60B20")]
	private bool IsReady()
	{
		GameObject gameObject = this.prefab;
		int num = 0;
		return gameObject != num;
	}

	// Token: 0x06000DE3 RID: 3555 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x6000DE3")]
	[Address(RVA = "0xA60B80", Offset = "0xA5F980", VA = "0x180A60B80")]
	public GameObject NewUse(Vector3 position, Quaternion rotation, bool withSound = true)
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x06000DE4 RID: 3556 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x6000DE4")]
	[Address(RVA = "0xA60CD0", Offset = "0xA5FAD0", VA = "0x180A60CD0")]
	public GameObject NewUse(bool withSound = true)
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x06000DE5 RID: 3557 RVA: 0x0002156C File Offset: 0x0001F76C
	[Token(Token = "0x6000DE5")]
	[Address(RVA = "0xA60FB0", Offset = "0xA5FDB0", VA = "0x180A60FB0")]
	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: 0x06000DE6 RID: 3558 RVA: 0x0002159C File Offset: 0x0001F79C
	[Token(Token = "0x6000DE6")]
	[Address(RVA = "0xA610D0", Offset = "0xA5FED0", VA = "0x180A610D0")]
	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: 0x06000DE7 RID: 3559 RVA: 0x000215D8 File Offset: 0x0001F7D8
	[Token(Token = "0x6000DE7")]
	[Address(RVA = "0xA61010", Offset = "0xA5FE10", VA = "0x180A61010")]
	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: 0x06000DE8 RID: 3560 RVA: 0x00021624 File Offset: 0x0001F824
	[Token(Token = "0x6000DE8")]
	[Address(RVA = "0xA60050", Offset = "0xA5EE50", VA = "0x180A60050")]
	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: 0x06000DE9 RID: 3561 RVA: 0x00021674 File Offset: 0x0001F874
	[Token(Token = "0x6000DE9")]
	[Address(RVA = "0xA5F6B0", Offset = "0xA5E4B0", VA = "0x180A5F6B0")]
	public Transform GetSource()
	{
		return this.prefab.transform;
	}

	// Token: 0x06000DEA RID: 3562 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x6000DEA")]
	[Address(RVA = "0xA60410", Offset = "0xA5F210", VA = "0x180A60410")]
	public GameObject GetGameObject()
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x06000DEB RID: 3563 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x6000DEB")]
	[Address(RVA = "0xA602A0", Offset = "0xA5F0A0", VA = "0x180A602A0")]
	public GameObject[] GetAllGameObjects()
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x06000DEC RID: 3564 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x6000DEC")]
	[Address(RVA = "0xA60420", Offset = "0xA5F220", VA = "0x180A60420")]
	public ParticleSystem GetParticle()
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x06000DED RID: 3565 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x6000DED")]
	[Address(RVA = "0xA60460", Offset = "0xA5F260", VA = "0x180A60460")]
	public SoundEffect GetSoundEffect()
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x06000DEE RID: 3566 RVA: 0x00021694 File Offset: 0x0001F894
	[Token(Token = "0x6000DEE")]
	[Address(RVA = "0xA5F440", Offset = "0xA5E240", VA = "0x180A5F440")]
	public float GetAliveTime()
	{
		return this.data.aliveTime;
	}

	// Token: 0x06000DEF RID: 3567 RVA: 0x000216B4 File Offset: 0x0001F8B4
	[Token(Token = "0x6000DEF")]
	[Address(RVA = "0xA60140", Offset = "0xA5EF40", VA = "0x180A60140", 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: 0x06000DF0 RID: 3568 RVA: 0x000216F0 File Offset: 0x0001F8F0
	[Token(Token = "0x6000DF0")]
	[Address(RVA = "0xA601F0", Offset = "0xA5EFF0", VA = "0x180A601F0")]
	private EffectUpdater GenerateUpdater()
	{
		GameObject gameObject = this.prefab;
		Transform transform = this.root;
		return new EffectUpdater(UnityEngine.Object.Instantiate<GameObject>(gameObject, transform));
	}

	// Token: 0x06000DF1 RID: 3569 RVA: 0x00021718 File Offset: 0x0001F918
	[Token(Token = "0x6000DF1")]
	[Address(RVA = "0xA60470", Offset = "0xA5F270", VA = "0x180A60470")]
	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: 0x06000DF2 RID: 3570 RVA: 0x00021794 File Offset: 0x0001F994
	[Token(Token = "0x6000DF2")]
	[Address(RVA = "0xA60F30", Offset = "0xA5FD30", VA = "0x180A60F30")]
	private void ReturnUpdater(EffectUpdater updater)
	{
		updater.Dispose();
		this.updaterPool.Return(updater);
		if (updater == this.lastActiveUpdater)
		{
		}
	}

	// Token: 0x06000DF3 RID: 3571 RVA: 0x000217C4 File Offset: 0x0001F9C4
	[Token(Token = "0x6000DF3")]
	[Address(RVA = "0xA611C0", Offset = "0xA5FFC0", VA = "0x180A611C0")]
	public EffectPool()
	{
	}

	// Token: 0x04001896 RID: 6294
	[FieldOffset(Offset = "0x10")]
	[Token(Token = "0x4001896")]
	private GameObject prefab;

	// Token: 0x04001897 RID: 6295
	[FieldOffset(Offset = "0x18")]
	[Token(Token = "0x4001897")]
	private Transform root;

	// Token: 0x04001898 RID: 6296
	[FieldOffset(Offset = "0x20")]
	[Token(Token = "0x4001898")]
	private EffectControlData data;

	// Token: 0x04001899 RID: 6297
	[FieldOffset(Offset = "0x28")]
	[Token(Token = "0x4001899")]
	private float timeScale = 1f;

	// Token: 0x0400189A RID: 6298
	[FieldOffset(Offset = "0x2C")]
	[Token(Token = "0x400189A")]
	private float recycleTime;

	// Token: 0x0400189B RID: 6299
	[FieldOffset(Offset = "0x30")]
	[Token(Token = "0x400189B")]
	private ObjectPoolLimited<EffectUpdater> updaterPool;

	// Token: 0x0400189C RID: 6300
	[FieldOffset(Offset = "0x38")]
	[Token(Token = "0x400189C")]
	private EffectUpdater lastActiveUpdater;

	// Token: 0x0400189D RID: 6301
	[FieldOffset(Offset = "0x40")]
	[Token(Token = "0x400189D")]
	private Action<EffectUpdater> effectUpdaterTimeScaleProcessor;

	// Token: 0x0400189E RID: 6302
	[FieldOffset(Offset = "0x48")]
	[Token(Token = "0x400189E")]
	private Action<EffectUpdater> effectUpdaterStopProcessor;

	// Token: 0x0400189F RID: 6303
	[FieldOffset(Offset = "0x50")]
	[Token(Token = "0x400189F")]
	private Action<EffectUpdater> effectUpdaterDisposeProcessor;

	// Token: 0x040018A0 RID: 6304
	[FieldOffset(Offset = "0x58")]
	[Token(Token = "0x40018A0")]
	private bool hasDisposed;
}
