docs.unity.cn
    Show / Hide Table of Contents

    Method GetSingletonBuffer

    GetSingletonBuffer<T>(Boolean)

    Gets the value of a singleton buffer component.

    Declaration
    [Obsolete("Use SystemAPI.GetSingletonBuffer instead (RemovedAfter Entities 1.0)")]
    public DynamicBuffer<T> GetSingletonBuffer<T>(bool isReadOnly = false)
        where T : struct, IBufferElementData
    Parameters
    Type Name Description
    Boolean isReadOnly

    True if the caller only requires read-only access to this data.

    Returns
    Type Description
    DynamicBuffer<T>

    The buffer.

    Type Parameters
    Name Description
    T

    The IBufferElementData subtype of the singleton component buffer element. This component type must not implement IEnableableComponent

    Remarks

    For managed components, put 'this.' in front to use GetSingleton<T>(ComponentSystemBase)

    See Also
    GetSingleton<T>()
    Back to top Copyright © 2023 Unity Technologies — Terms of use
    Generated by DocFX
    on Wednesday, June 21, 2023