docs.unity3d.com
    Show / Hide Table of Contents

    Method GetComponentDataFromEntity

    GetComponentDataFromEntity<T>(Boolean)

    Gets an dictionary-like container containing all components of type T, keyed by Entity.

    Declaration
    public ComponentDataFromEntity<T> GetComponentDataFromEntity<T>(bool isReadOnly = false)
        where T : struct, IComponentData
    Parameters
    Type Name Description
    Boolean isReadOnly

    Whether the data is only read, not written. Access data as read-only whenever possible.

    Returns
    Type Description
    ComponentDataFromEntity<T>

    All component data of type T.

    Type Parameters
    Name Description
    T

    A struct that implements IComponentData.

    Remarks

    When you call this method on the main thread, it invokes GetComponentDataFromEntity<T>(Boolean). (An Entities.ForEach function invoked with Run() executes on the main thread.) When you call this method inside a job scheduled using Entities.ForEach, this method gets replaced direct access to ComponentDataFromEntity<T>.

    In This Article
    • GetComponentDataFromEntity<T>(Boolean)
    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023