You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
65 lines
1.5 KiB
65 lines
1.5 KiB
using System;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
namespace MU3
|
|
{
|
|
// Token: 0x02000724 RID: 1828
|
|
public class AutoPushToCacheParticle : MonoBehaviour
|
|
{
|
|
// Token: 0x06002F4D RID: 12109 RVA: 0x000FC5B4 File Offset: 0x000FC5B4
|
|
private void OnEnable()
|
|
{
|
|
this.particleSystems_ = EffectListResource.popParticleSystems();
|
|
base.GetComponentsInChildren<ParticleSystem>(this.particleSystems_);
|
|
this.time_ = 0f;
|
|
}
|
|
|
|
// Token: 0x06002F4E RID: 12110 RVA: 0x000FC5D8 File Offset: 0x000FC5D8
|
|
private void OnDisable()
|
|
{
|
|
EffectListResource.pushParticleSystems(ref this.particleSystems_);
|
|
}
|
|
|
|
// Token: 0x06002F4F RID: 12111 RVA: 0x000FC5E8 File Offset: 0x000FC5E8
|
|
private void Update()
|
|
{
|
|
this.time_ += Time.deltaTime;
|
|
if (this.time_ < this.duration_)
|
|
{
|
|
return;
|
|
}
|
|
int num = 0;
|
|
for (int i = 0; i < this.particleSystems_.Count; i++)
|
|
{
|
|
num += this.particleSystems_[i].particleCount;
|
|
}
|
|
if (num <= 0)
|
|
{
|
|
if (this.objectCache_ == null)
|
|
{
|
|
UnityEngine.Object.Destroy(base.gameObject);
|
|
}
|
|
else
|
|
{
|
|
this.objectCache_.push(base.gameObject);
|
|
}
|
|
}
|
|
}
|
|
|
|
// Token: 0x040054CC RID: 21708
|
|
[Header("↓時間後に、パーティクル個数が0個になるとGameObjectを消滅させます")]
|
|
[SerializeField]
|
|
private float duration_;
|
|
|
|
// Token: 0x040054CD RID: 21709
|
|
public ObjectCache objectCache_;
|
|
|
|
// Token: 0x040054CE RID: 21710
|
|
private float time_;
|
|
|
|
// Token: 0x040054CF RID: 21711
|
|
private List<ParticleSystem> particleSystems_;
|
|
}
|
|
}
|