Auxiliary class to overcome the problem of references to pooled objects that should become
null when
objects are moved back to the pool after calling
Destroy(GameObject).
Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 8.0.0.0 (8.0.0.0)
Syntax
C# |
---|
public class PoolableReference<T>
where T : Component
|
Type Parameters
Examples
Instead of a normal reference to a script component on a poolable object use
| Copy |
---|
MyScriptComponent scriptComponent = PoolableObjectController.Instantiate( prefab ).GetComponent<MyScriptComponent>();
var myReference = new PoolableReference<MyScriptComponent>( scriptComponent );
if( myReference.Get() != null )
{
myReference.Get().MyComponentFunction();
} |
Inheritance Hierarchy
See Also