Code Reference‎ > ‎SpawnPool‎ > ‎

.Despawn()

Despawn(Transform instance)

return: void

Description
If the passed transform is managed by the SpawnPool, it will be deactivated and made available to be spawned again.

PoolManager.Pools["Enemies"].Despawn(enemyInstance);



Despawn(Transform instance, float seconds)

return: 
void

Description
Delay the despawn for X seconds. See Timed Spawn/Despawn for more informaiton

// Despawn the instance after 5 seconds
PoolManager
.Pools["Enemies"].Despawn(enemyInstance, 5);



Despawn(Transform instanceTransform parent)

return: void

Description
Adds an optional parent to be set just before despawn. If you pass null, the instance will be un-parented so it is directly in the scene root.

PoolManager.Pools["Enemies"].Despawn(enemyInstance, parent);



Despawn(Transform instance, float secondsTransform parent)

return: 
void

Description
Adds an optional parent to be set just before despawn. If you pass null, the instance will be un-parented so it is directly in the scene root.

// Despawn the instance after 5 seconds
PoolManager
.Pools["Enemies"].Despawn(enemyInstance, 5, parent);