docs.unity.cn
    Show / Hide Table of Contents

    Method AddComponent

    AddComponent<T>(Entity, T)

    Declaration
    public void AddComponent<T>(Entity e, T component)
        where T : struct, IComponentData
    Parameters
    Type Name Description
    Entity e
    T component
    Type Parameters
    Name Description
    T

    AddComponent<T>(Entity)

    Declaration
    public void AddComponent<T>(Entity e)
        where T : struct, IComponentData
    Parameters
    Type Name Description
    Entity e
    Type Parameters
    Name Description
    T

    AddComponent(Entity, ComponentType)

    Declaration
    public void AddComponent(Entity e, ComponentType componentType)
    Parameters
    Type Name Description
    Entity e
    ComponentType componentType

    AddComponent(Entity, ComponentTypes)

    Records a command to add one or more components to an entity.

    Declaration
    public void AddComponent(Entity e, ComponentTypes componentTypes)
    Parameters
    Type Name Description
    Entity e

    The entity to get additional components.

    ComponentTypes componentTypes

    The types of components to add.

    AddComponent(EntityQuery, ComponentType)

    Records a command to add a component to all entities matching a query.

    Declaration
    public void AddComponent(EntityQuery entityQuery, ComponentType componentType)
    Parameters
    Type Name Description
    EntityQuery entityQuery

    The query specifying which entities to add the component to.

    ComponentType componentType

    The type of component to add.

    Remarks

    The query is performed at playback time, not when the method is called.

    AddComponent(EntityQuery, ComponentTypes)

    Records a command to add one or more components to all entities matching a query.

    Declaration
    public void AddComponent(EntityQuery entityQuery, ComponentTypes types)
    Parameters
    Type Name Description
    EntityQuery entityQuery

    The query specifying which entities get the added components.

    ComponentTypes types
    Remarks

    The query is performed at playback time, not when the method is called.

    AddComponent<T>(EntityQuery)

    Records a command to add a component to all entities matching a query.

    Declaration
    public void AddComponent<T>(EntityQuery entityQuery)
    Parameters
    Type Name Description
    EntityQuery entityQuery

    The query specifying which entities get the added component.

    Type Parameters
    Name Description
    T

    The type of component to add.

    Remarks

    The query is performed at playback time, not when the method is called.

    Back to top Copyright © 2020 Unity Technologies
    Generated by DocFX
    on Friday, May 28, 2021