docs.unity.cn
    Show / Hide Table of Contents

    Method GetComponentData

    GetComponentData<T>(EntityManager, Entity)

    Gets the value of a component for an entity.

    Declaration
    public static T GetComponentData<T>(this EntityManager manager, Entity entity)
        where T : class, IComponentData
    Parameters
    Type Name Description
    EntityManager manager
    Entity entity

    The entity.

    Returns
    Type Description
    T

    A struct of type T containing the component value.

    Type Parameters
    Name Description
    T

    The type of component to retrieve.

    Exceptions
    Type Condition
    ArgumentException

    Thrown if the component type has no fields.

    Back to top Copyright © 2022 Unity Technologies
    Generated by DocFX
    on Wednesday, July 6, 2022
    Terms of use