Class ObjectPool<T> | Package Manager UI website
docs.unity3d.com
    Show / Hide Table of Contents

    Class ObjectPool<T>

    Inheritance
    System.Object
    ObjectPool<T>
    Namespace: UnityEngine.Rendering
    Syntax
    public class ObjectPool<T>
        where T : new()
    Type Parameters
    Name Description
    T

    Constructors

    ObjectPool(UnityAction<T>, UnityAction<T>)

    Declaration
    public ObjectPool(UnityAction<T> actionOnGet, UnityAction<T> actionOnRelease)
    Parameters
    Type Name Description
    UnityAction<T> actionOnGet
    UnityAction<T> actionOnRelease

    Properties

    countActive

    Declaration
    public int countActive { get; }
    Property Value
    Type Description
    System.Int32

    countAll

    Declaration
    public int countAll { get; }
    Property Value
    Type Description
    System.Int32

    countInactive

    Declaration
    public int countInactive { get; }
    Property Value
    Type Description
    System.Int32

    Methods

    Get()

    Declaration
    public T Get()
    Returns
    Type Description
    T

    Get(out T)

    Declaration
    public ObjectPool<T>.PooledObject Get(out T v)
    Parameters
    Type Name Description
    T v
    Returns
    Type Description
    ObjectPool.PooledObject<>

    Release(T)

    Declaration
    public void Release(T element)
    Parameters
    Type Name Description
    T element
    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023