void OnDestroy() { DestroyPool(); if (_inst == this) { _inst = null; } }
void Awake() { if (_inst != null) { Debug.LogError("CharacterEffectMananger: detected singleton instance has existed. Destroy this one " + gameObject.name); Destroy(this); return; } InstantiatePool(); _inst = this; }