PoolableReferenceT Class |
Namespace: (Default Namespace)
The PoolableReferenceT type exposes the following members.
Name | Description | |
---|---|---|
PoolableReferenceT |
Initializes a new instance of the PoolableReferenceT class with a null reference.
| |
PoolableReferenceT(T) |
Initializes a new instance of the PoolableReferenceT class with the specified reference.
| |
PoolableReferenceT(PoolableReferenceT) |
Initializes a new instance of the PoolableReferenceT class from
a given PoolableReferenceT.
|
Name | Description | |
---|---|---|
Get |
Gets the reference to the script component, or null if the object was
already destroyed or moved to the pool.
| |
Reset |
Resets the reference to null.
| |
Set(T) | ||
Set(T, Boolean) |
Sets the reference to a poolable object with the specified component.
|
MyScriptComponent scriptComponent = PoolableObjectController.Instantiate( prefab ).GetComponent<MyScriptComponent>(); var myReference = new PoolableReference<MyScriptComponent>( scriptComponent ); if( myReference.Get() != null ) // will check if poolable instance still belongs to the original object { myReference.Get().MyComponentFunction(); }