docs.unity.cn
    Show / Hide Table of Contents

    Method GetAspect

    GetAspect<T>(Entity)

    Look up an aspect for an entity.

    Declaration
    [ExcludeFromBurstCompatTesting("This unfortunately needs access to the managed world for the ExternalAPIState.")]
    public T GetAspect<T>(Entity entity)
        where T : struct, IAspect, IAspectCreate<T>
    Parameters
    Type Name Description
    Entity entity

    The entity.

    Returns
    Type Description
    T

    An aspect struct of type T representing the aspect on the entity.

    Type Parameters
    Name Description
    T

    The type of aspect to retrieve.

    Remarks

    T must implement the IAspect interface. The given entity is assumed to have all the components required by the aspect type.

    Back to top Copyright © 2023 Unity Technologies — Terms of use
    Generated by DocFX
    on Wednesday, June 21, 2023