docs.unity.cn
    Show / Hide Table of Contents

    Struct RefRO<T>

    ReadOnlyRef stores a safe read-only reference to a component data.

    Namespace: Unity.Entities
    Syntax
    [GenerateTestsForBurstCompatibility(GenericTypeArguments = new Type[]{typeof(BurstCompatibleComponentData)}, RequiredUnityDefine = "ENABLE_UNITY_COLLECTIONS_CHECKS")]
    public readonly struct RefRO<T> : IQueryTypeParameter where T : struct, IComponentData
    Type Parameters
    Name Description
    T

    Type of this component

    Constructors

    Name Description
    RefRO(NativeArray<T>, Int32)

    Stores a safe reference to a component from an array of components at the index.

    Properties

    Name Description
    IsValid

    Property that returns true if the reference is valid, false otherwise.

    ValueRO

    Returns a read-only reference to the component value itself.

    Methods

    Name Description
    Optional(NativeArray<T>, Int32)

    Stores a safe reference to a component from an array of components at the index. If the array is empty stores a null reference.

    Back to top Copyright © 2023 Unity Technologies — Terms of use
    Generated by DocFX
    on Wednesday, June 21, 2023