docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method HasComponent

    HasComponent(Type)

    Determine if a component type is stored in this container or its dependencies. Throws if component type is not in UsedComponents list.

    Declaration
    public bool HasComponent(Type type)
    Parameters
    Type Name Description
    Type type

    Type of the component.

    Returns
    Type Description
    bool

    true if the is found, otherwise false.

    HasComponent<T>()

    Determine if a component type is stored in this container or its dependencies. Throws if component type is not in UsedComponents list.

    Declaration
    public bool HasComponent<T>() where T : IBuildComponent
    Returns
    Type Description
    bool

    true if the is found, otherwise false.

    Type Parameters
    Name Description
    T

    The component 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)