docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Struct RefRW<T>

    RefRW stores a reference (with write access) to native memory

    Implements
    IQueryTypeParameter
    Namespace: Unity.Entities
    Assembly: Unity.Entities.dll
    Syntax
    public readonly struct RefRW<T> : IQueryTypeParameter where T : struct, IComponentData
    Type Parameters
    Name Description
    T

    The type of object referenced.

    Constructors

    Name Description
    RefRW(byte*, AtomicSafetyHandle)

    Stores a safe reference a pointer to T

    RefRW(NativeArray<T>, int)

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

    Properties

    Name Description
    IsValid

    Checks if the component exists on this entity.

    ValueRO

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

    ValueRW

    Returns a writable reference to the component value itself.

    Methods

    Name Description
    Optional(NativeArray<T>, int)

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

    Operators

    Name Description
    explicit operator RefRO<T>(RefRW<T>)

    Convert into a read-only version RefRO of this RefRW

    In This Article
    Back to top
    Copyright © 2024 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)