private void OnDestroy() { if (!_destroyCacheFlag) { _pool.DeleteFromInstance(this); } }
/// <summary> /// Automatic callback when gameObject is destroyed. /// </summary> private void OnDestroy() { if (!_deactivateCacheFlag) { _pool.DeleteFromInstance(this); } else { _deactivateCacheFlag = false; } }
public void DeleteObjectInstance() { _pool.DeleteFromInstance(this); }