docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method GetAspect

    GetAspect<T>(Entity)

    Look up an aspect for an entity.

    Declaration
    public static T GetAspect<T>(Entity entity) where T : unmanaged, IAspect
    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.

    In This Article
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)