PoolableBehaviour<T> Class

Summary

A UnityEngine.MonoBehaviour component which automatically detects the Weaver.ObjectPool`1 that created it so it can be released back to that pool (or simply destroyed if it wasn't created by a pool) using the Weaver.ObjectPool.TryReleaseOrDestroyGameObject``1(``0) extension method.

When inheriting from this class, T should always be the child class itself, I.E. class ChildClass : PoolableBehaviour<ChildClass>

More detailed instructons on how to use this class and those related to it can be found in the documentation.
Assembly
Weaver.dll
Namespace
Weaver
Interfaces
Base Types
  • MonoBehaviour
Derived Types
graph BT Type-->Base0["MonoBehaviour"] Type-.->Interface0["IPoolable"] click Interface0 "/weaver/api/Weaver/IPoolable" Type["PoolableBehaviour<T>"] class Type type-node Derived0["Explosion"]-->Type click Derived0 "/weaver/api/Weaver.Examples/Explosion" Derived1["FloatingText"]-->Type click Derived1 "/weaver/api/Weaver.Examples/FloatingText" Derived2["Missile"]-->Type click Derived2 "/weaver/api/Weaver.Examples/Missile"

Syntax

public abstract class PoolableBehaviour<T> : MonoBehaviour, IPoolable 
    where T : PoolableBehaviour<T>, IPoolable

Type Parameters

Name Description
T

Fields

Name Constant Value Summary
Pool
The pool that created this object (or null if not created by a pool).

Methods

Name Value Summary
AfterInspectorGUI() void
[Editor-Only] Inspector Gadgets GUI event.
OnRelease() void
Called by the Weaver.PoolableBehaviour`1.Pool when releasing this component to it. Asserts that the UnityEngine.Component.gameObject was active and deactivates it (unless overridden).