using System.Collections; using System.Collections.Generic; using UnityEngine; public class RepoolParticleEffects : MonoBehaviour { private void OnEnable() { if(transform.TryGetComponent(out AudioSource source)) { source.Play(); } } private void OnParticleSystemStopped() { //Debug.Log("Particle Stopped emitting. Repooling."); string baseName = NetworkPooler.GetBaseName(gameObject.name); //Debug.Log($"basename: {baseName}"); NetworkPooler.Instance.PooledDestroy(baseName, gameObject); } }