A* Pathfinding Project  4.0.9
The A* Pathfinding Project for Unity 3D
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Properties Events Macros Groups Pages
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

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

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