PooledGameObject

February 9, 2024 ยท View on GitHub

Namespace: Unity.TinyCharacterController.Utility


Summary:

PooledGameObject is a component for managing objects pooled by GameObjectPool. It can be obtained through IGameObjectPool.Get() and released with IGameObjectPool.Release(IPooledObject).

Features and Operation:

  • Lifetime Feature Utilization: Configures the object to be automatically released after a certain period.
  • Release Callback: Invokes a callback event when the object is released.

Properties

NameDescription
_isUseLifetimeWhether to use the lifetime feature or not.
_lifeTimeThe duration the object remains valid.
OnReleaseByLifeTimeCallback invoked when the object is released due to its lifetime.
IsUsedWhether the PooledGameObject is in use.
ReleaseTimeThe time when the PooledGameObject will be released.
IsPlayingWhether the PooledGameObject is currently active.

Methods

  • There are no public methods.

Additional Notes

  • PooledGameObject implements the IPooledObject interface, providing the basic interface for objects managed within the pool system.
  • The lifetime feature allows for efficient management of resources by automatically returning objects to the pool after a set duration.
  • When objects are released, the OnReleaseByLifeTime event is triggered, allowing for additional cleanup or notification processes to be performed.