private void release() { if (PoolMan.IsSpawned(transform)) { PoolMan.Despawn(transform); } else if (!PoolMan.Contains(transform)) { Destroy(gameObject); } }
void OnDespawned() { this.Dispose(); for (int i = AllinPlayersParent.childCount - 1; i > -1; i--) { var child = AllinPlayersParent.GetChild(i); if (PoolMan.Contains(child)) { PoolMan.Despawn(child); } } }