Mirror Networking
Mirror.Pool< T > Class Template Reference

Public Member Functions

 Pool (Func< T > objectGenerator, int initialCapacity)
 
Take ()
 
Get ()
 
void Return (T item)
 

Properties

int Count [get]
 

Detailed Description

Definition at line 9 of file Pool.cs.

Constructor & Destructor Documentation

◆ Pool()

Mirror.Pool< T >.Pool ( Func< T >  objectGenerator,
int  initialCapacity 
)

Definition at line 18 of file Pool.cs.

19 {
20 this.objectGenerator = objectGenerator;
21
22 // allocate an initial pool so we have fewer (if any)
23 // allocations in the first few frames (or seconds).
24 for (int i = 0; i < initialCapacity; ++i)
25 objects.Push(objectGenerator());
26 }

Property Documentation

◆ Count

int Mirror.Pool< T >.Count
get

Definition at line 41 of file Pool.cs.