A* Pathfinding Project  4.1.19
The A* Pathfinding Project for Unity 3D
ObjectPool< T > Class Template Reference

Lightweight object Pool for IAstarPooledObject. More...

Detailed Description

Lightweight object Pool for IAstarPooledObject.

Handy class for pooling objects of type T which implements the IAstarPooledObject interface.

Usage:

  • Claim a new object using
    SomeClass foo = ObjectPool<SomeClass>.Claim ();
  • Use it and do stuff with it
  • Release it with
    ObjectPool<SomeClass>.Release (foo);

After you have released a object, you should never use it again.

Since
Version 3.2
Version
Since 3.7.6 this class is thread safe
See also
Pathfinding.Util.ListPool
ObjectPoolSimple
Type Constraints
T :class 
T :IAstarPooledObject 
T :new() 

Static Public Member Functions

static T Claim ()
 
static void Release (ref T obj)
 

Member Function Documentation

◆ Claim()

static T Claim ( )
static

◆ Release()

static void Release ( ref T  obj)
static

The documentation for this class was generated from the following file: