docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method HasComponent

    HasComponent(Type)

    Determine if a component exist in this container or dependencies recursively.

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

    The component type.

    Returns
    Type Description
    bool

    true if the component is found, false otherwise.

    HasComponent<T>()

    Determine if a component exist in this container or dependencies recursively.

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

    true if the component is found, false otherwise.

    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)