docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class RTHandleCollection

    Provides a collection class for mapping string and integer values to RTHandles.

    Inheritance
    object
    RTHandleCollection
    Implements
    IDisposable
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: UnityEditor.TerrainTools
    Assembly: Unity.TerrainTools.Editor.dll
    Syntax
    public class RTHandleCollection : IDisposable

    Constructors

    RTHandleCollection()

    Initializes and returns an instance of RTHandleCollection.

    Declaration
    public RTHandleCollection()

    Properties

    this[int]

    Access an RTHandle using an int hash.

    Declaration
    public RTHandle this[int hash] { get; set; }
    Parameters
    Type Name Description
    int hash

    The hash or integer value used to access the RTHandle.

    Property Value
    Type Description
    RTHandle

    this[string]

    Access an RTHandle using a string.

    Declaration
    public RTHandle this[string name] { get; set; }
    Parameters
    Type Name Description
    string name

    The name used to access the RTHandle.

    Property Value
    Type Description
    RTHandle

    Methods

    AddRTHandle(int, string, GraphicsFormat)

    Adds an RTHandle description to the RTHandleCollection for later use when you call GatherRTHandles(int, int, int).

    Declaration
    public void AddRTHandle(int hash, string name, GraphicsFormat format)
    Parameters
    Type Name Description
    int hash

    The hash or integer value used to identify the RTHandle.

    string name

    The name used to identify the RTHandle.

    GraphicsFormat format

    The GraphicsFormat to use for the RTHandle description.

    ContainsRTHandle(string)

    Checks to see if an RTHandle with the provided name already exists.

    Declaration
    public bool ContainsRTHandle(string name)
    Parameters
    Type Name Description
    string name

    The name used to identify an RTHandle in this RTHandleCollection.

    Returns
    Type Description
    bool

    Returns true if the RTHandle exists.

    Dispose()

    Calls the overridden Dispose(bool) method.

    Declaration
    public void Dispose()

    Dispose(bool)

    Releases the gathered RTHandle resources, and clears the RTHandleCollection Dictionary.

    Declaration
    public virtual void Dispose(bool dispose)
    Parameters
    Type Name Description
    bool dispose

    Whether to dispose resources when clearing releasing the RTHandleCollection. When the value is true, Unity disposes of resources. Otherwise, Unity does not dispose of resources.

    Remarks

    Override this method if you create a class that derives from RTHandleCollection.

    See Also
    ReleaseRTHandles()

    GatherRTHandles(int, int, int)

    Gathers all added RTHandles using the width, height, and depth values, if provided.

    Declaration
    public void GatherRTHandles(int width, int height, int depth = 0)
    Parameters
    Type Name Description
    int width

    The width of the RTHandle to gather.

    int height

    The height of the RTHandle to gather.

    int depth

    The optional depth of the RTHandle to gather.

    GetRTHandle(int)

    Checks to see if an RTHandle with the provided hash value already exists.

    Declaration
    public RTHandle GetRTHandle(int hash)
    Parameters
    Type Name Description
    int hash

    The hash or integer value used to identify an RTHandle in this RTHandleCollection.

    Returns
    Type Description
    RTHandle

    Returns the RTHandle reference associated with the provided hash or integer value. Returns NULL if the key isn't found.

    OnSceneGUI(float)

    Renders a debug GUI in the SceneView that displays all the RTHandles in this RTHandleCollection.

    Declaration
    public void OnSceneGUI(float size)
    Parameters
    Type Name Description
    float size

    The size used to draw the Textures.

    ReleaseRTHandles()

    Releases the gathered RTHandle resources.

    Declaration
    public void ReleaseRTHandles()

    Implements

    IDisposable
    In This Article
    Back to top
    Copyright © 2025 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)