projectEli/Assets/NeoFPS/Core/Utilities/ParticleSystemPlayOnEnable.cs

20 lines
549 B
C#
Raw Normal View History

2022-11-07 01:28:33 +00:00
using UnityEngine;
namespace NeoFPS
{
public class ParticleSystemPlayOnEnable : MonoBehaviour
{
[SerializeField, Tooltip("The particle systems to play on enabling the object")]
private ParticleSystem[] m_ParticleSystems = { };
private void OnEnable()
{
for (int i = 0; i < m_ParticleSystems.Length; ++i)
{
// Play the particle system
if (m_ParticleSystems[i] != null)
m_ParticleSystems[i].Play();
}
}
}
}