Class RTHandleCollection
Provides a collection class for mapping string and integer values to RTHandles.
Namespace: UnityEditor.TerrainTools
Syntax
public class RTHandleCollection : IDisposable
Constructors
RTHandleCollection()
Initializes and returns an instance of RTHandleCollection.
Declaration
public RTHandleCollection()
Properties
Item[Int32]
Access an RTHandle using an int
hash.
Declaration
public RTHandle this[int hash] { get; set; }
Parameters
Type | Name | Description |
---|---|---|
Int32 | hash |
Property Value
Type | Description |
---|---|
RTHandle |
Item[String]
Access an RTHandle using a string
.
Declaration
public RTHandle this[string name] { get; set; }
Parameters
Type | Name | Description |
---|---|---|
String | name |
Property Value
Type | Description |
---|---|
RTHandle |
Methods
AddRTHandle(Int32, String, GraphicsFormat)
Adds an RTHandle description to the RTHandleCollection for later use when you call GatherRTHandles(Int32, Int32, Int32).
Declaration
public void AddRTHandle(int hash, string name, GraphicsFormat format)
Parameters
Type | Name | Description |
---|---|---|
Int32 | hash | The hash or integer value used to identify the RTHandle. |
String | name | The name used to identify the RTHandle. |
UnityEngine.Experimental.Rendering.GraphicsFormat | format | The UnityEngine.Experimental.Rendering.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 |
---|---|
Boolean | Returns |
Dispose()
Calls the overridden Dispose(Boolean) method.
Declaration
public void Dispose()
Dispose(Boolean)
Releases the gathered RTHandle resources, and clears the RTHandleCollection Dictionary
.
Declaration
public virtual void Dispose(bool dispose)
Parameters
Type | Name | Description |
---|---|---|
Boolean | dispose | Whether to dispose resources when clearing releasing the RTHandleCollection.
When the value is |
Remarks
Override this method if you create a class that derives from RTHandleCollection.
See Also
GatherRTHandles(Int32, Int32, Int32)
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 |
---|---|---|
Int32 | width | The width of the RTHandle to gather. |
Int32 | height | The height of the RTHandle to gather. |
Int32 | depth | The optional depth of the RTHandle to gather. |
GetRTHandle(Int32)
Checks to see if an RTHandle with the provided hash value already exists.
Declaration
public RTHandle GetRTHandle(int hash)
Parameters
Type | Name | Description |
---|---|---|
Int32 | 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 |
OnSceneGUI(Single)
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 |
---|---|---|
Single | size | The size used to draw the Textures. |
ReleaseRTHandles()
Releases the gathered RTHandle resources.
Declaration
public void ReleaseRTHandles()