docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method GetComponentBoxed

    GetComponentBoxed(Entity, ComponentType)

    Gets the component object of a given entity

    Declaration
    public object GetComponentBoxed(Entity entity, ComponentType type)
    Parameters
    Type Name Description
    Entity entity

    The entity

    ComponentType type

    The component type to get the object of

    Returns
    Type Description
    object

    The component object

    Exceptions
    Type Condition
    ArgumentException

    Throws if the type does not exist on the entity

    GetComponentBoxed(Entity, Type)

    Gets the component object of a given entity based on the type

    Declaration
    public object GetComponentBoxed(Entity entity, Type type)
    Parameters
    Type Name Description
    Entity entity

    The entity

    Type type

    The type to get the object of

    Returns
    Type Description
    object

    The component object

    Exceptions
    Type Condition
    ArgumentException

    Throws if the type does not exist on the entity

    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)