Function Path.Release

Release (System.Object o, bool silent=…)

Reduces the reference count on the path by 1 (pooling).

Public
void Release (

System.Object

o

bool

silent=false

)

Reduces the reference count on the path by 1 (pooling).

Removes the claim on the path by the specified object. When the reference count reaches zero, the path will be pooled, all variables will be cleared and the path will be put in a pool to be used again. This is great for performance since fewer allocations are made.

If the silent parameter is true, this method will remove the claim by the specified object but the path will not be pooled if the claim count reches zero unless a non-silent Release call has been made earlier. This is used by the internal pathfinding components such as Seeker and AstarPath so that they will not cause paths to be pooled. This enables users to skip the claim/release calls if they want without the path being pooled by the Seeker or AstarPath and thus causing strange bugs.

See

Claim

PathPool