24 lines
587 B
C#
24 lines
587 B
C#
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);
|
|
}
|
|
|
|
}
|