Skip to content

v2.0.0

Choose a tag to compare

@Orange-Panda Orange-Panda released this 18 Nov 20:17
· 24 commits to main since this release

This major release has been created due to several breaking changes to the ObjectPool system.
Upgrading to this release will require updating syntax of scripts that utilize poolables.

Added

  • Added Poolable.Instance class, enabling usage of poolables that expire when the object is returned.
  • Added Poolable.Identifier property: a unique id that is assigned to a poolable when retrieved and revoked when returned.

Changed

  • Poolable objects that are incorrectly created using Object.Instantiate are now immediately destroyed and log an error.
  • ⚠️Breaking: The ObjectPool.Instantiate methods now return a Poolable.Instance instead of the Poolable itself.
    • To update: replace variable type with Poolable.Instance.
    • Use Poolable.Instance.IsActive to check if the instance is not null
      • Instances can be implicitly cast to bool for this check as well.
    • Use Poolable.Instance.Poolable to access the Poolable behavior as before
      • Will return null when the Poolable has been returned or disposed.

Removed

  • ⚠️Breaking: Removed public access to Poolable.poolSettings
    • The pool settings defined on the Poolable component should not be modified at runtime.
  • ⚠️Breaking: Removed set access for values of PoolSettings
    • Modifying these values directly had very erratic behavior.