Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


PooledObject<T>

A pooled object wraps a reference to an instance returned to the pool when the pooled object is disposed of.
Read time 1 minuteLast updated 10 days ago

Definition

public struct PooledObject<T> : IDisposable where T : class

Remarks

It automates the return of references to avoid manual handling.
The following example shows how to use a PooledObject:

Constructors

Constructor

Description

PooledObject`1(`0,UnityEngine.Pool.IObjectPool{`0})Initializes the pooled object with a managed object and specifies the pool to which the instance is returned.