docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method RemoveComponent

    RemoveComponent(Type)

    Remove all components that matches the component type.

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

    The component type.

    Returns
    Type Description
    bool

    true if one or more component was removed, false otherwise.

    RemoveComponent<T>()

    Remove all components that matches the component type.

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

    true if one or more component was removed, false otherwise.

    Type Parameters
    Name Description
    T

    Type of the component.

    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)