ClientServer/Client/Assets/Scripts/Content/RepoolParticleEffects.cs
TG9six 03a642d635 first push
first push
2025-09-06 17:17:39 +04:00

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);
}
}