docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Struct FixedAttachmentArray<DataType>

    A fixed-size array that can contain up to maximum render target attachment amount of items.

    Inherited Members
    ValueType.Equals(object)
    ValueType.GetHashCode()
    ValueType.ToString()
    object.Equals(object, object)
    object.GetType()
    object.ReferenceEquals(object, object)
    Namespace: UnityEngine.Rendering.RenderGraphModule.NativeRenderPassCompiler
    Assembly: Unity.RenderPipelines.Core.Runtime.dll
    Syntax
    public struct FixedAttachmentArray<DataType> where DataType : unmanaged
    Type Parameters
    Name Description
    DataType

    The type of data to store in the array.

    Constructors

    FixedAttachmentArray(int)

    Created an new array with the specified number of attachments.

    Declaration
    public FixedAttachmentArray(int numAttachments)
    Parameters
    Type Name Description
    int numAttachments

    Number of attachments to consider valid.

    Exceptions
    Type Condition
    ArgumentException

    Thrown if the amount of elements is less than 0 or more than MaxAttachments

    FixedAttachmentArray(NativeArray<DataType>)

    Intialize the FixedAttachmentArray by copying data from the passed in native array.

    Declaration
    public FixedAttachmentArray(NativeArray<DataType> attachments)
    Parameters
    Type Name Description
    NativeArray<DataType> attachments

    The native array from which to copy the elements.

    FixedAttachmentArray(DataType[])

    Intialize the FixedAttachmentArray by copying data from the passed in c# array.

    Declaration
    public FixedAttachmentArray(DataType[] attachments)
    Parameters
    Type Name Description
    DataType[] attachments

    The C# array from which to copy the elements.

    Fields

    Empty

    Returns an empty array.

    Declaration
    public static FixedAttachmentArray<DataType> Empty
    Field Value
    Type Description
    FixedAttachmentArray<DataType>

    MaxAttachments

    The maximum number of elements that can be stored in the array.

    Declaration
    public const int MaxAttachments = 8
    Field Value
    Type Description
    int

    Properties

    this[int]

    Get the element at the specified index in the array.

    Declaration
    public ref DataType this[int index] { get; }
    Parameters
    Type Name Description
    int index

    Index of the element.

    Property Value
    Type Description
    DataType

    The value of the element.

    Exceptions
    Type Condition
    IndexOutOfRangeException

    If the index is outside the valid range.

    size

    Number of attachments in the array alway less or equal than MaxAttachments

    Declaration
    public int size { get; }
    Property Value
    Type Description
    int

    Methods

    Add(in DataType)

    Add an element tot the array.

    Declaration
    public int Add(in DataType data)
    Parameters
    Type Name Description
    DataType data

    Element to add

    Returns
    Type Description
    int

    Returns the index where the item was added.

    Exceptions
    Type Condition
    IndexOutOfRangeException

    If the maximum amount of elements (MaxAttachments) is reached.

    Clear()

    Clear the array.

    Declaration
    public void Clear()

    Extension Methods

    AnalyticsUtils.ToNestedColumnWithDefault<T>(T, T, bool)
    AnalyticsUtils.ToNestedColumn<T>(T, bool)
    AnalyticsUtils.ToNestedColumn<T>(T, T)
    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)