docs.unity.cn
    Show / Hide Table of Contents

    Method GetEntities

    GetEntities(Object)

    Returns all entities in the destination world that are associated with the given object. This includes the primary entity associated with the object as well as all additional entities that were associated with this object. The first entity returned by the enumerator is the primary entity.

    Declaration
    public MultiListEnumerator<Entity> GetEntities(Object uobject)
    Parameters
    Type Name Description
    Object uobject

    The object to get the entities for.

    Returns
    Type Description
    MultiListEnumerator<Entity>

    An enumerator that returns the associated entities.

    GetEntities(Component)

    Returns all entities in the destination world that are associated with the GameObject of the given component. This includes the primary entity associated with the object as well as all additional entities that were associated with this object. The first entity returned by the enumerator is the primary entity.

    Declaration
    public MultiListEnumerator<Entity> GetEntities(Component component)
    Parameters
    Type Name Description
    Component component

    The component whose GameObject to get the entities for.

    Returns
    Type Description
    MultiListEnumerator<Entity>

    An enumerator that returns the associated entities.

    Back to top Copyright © 2022 Unity Technologies
    Generated by DocFX
    on 04 August 2022
    Terms of use