Summary
If the `pool` isn't null this method gives the `item` to it and returns true.
Otherwise this method destroys it and returns false.
Note that this method is likely not what you want to use for
UnityEngine.Component
s.
Use Weaver.ObjectPool.TryReleaseOrDestroyGameObject``1(Weaver.ObjectPool{``0},``0)
instead.
- Assembly
- Weaver
.dll - Namespace
- Weaver
- Containing Type
- ObjectPool
Syntax
public static bool TryReleaseOrDestroy<T>(this ObjectPool<T> pool, T item) where T : Object
Type Parameters
Name | Description |
---|---|
T |
Parameters
Name | Type | Description |
---|---|---|
pool | ObjectPool |
|
item | T |
Return Value
Type | Description |
---|---|
bool |