docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method TryGetComponent

    TryGetComponent(Type, out IBuildComponent)

    Try to get the value of a component type. Throws if component type is not in UsedComponents list.

    Declaration
    public bool TryGetComponent(Type type, out IBuildComponent value)
    Parameters
    Type Name Description
    Type type

    The component type.

    IBuildComponent value

    The component value.

    Returns
    Type Description
    bool

    true if the component is found, otherwise false.

    TryGetComponent<T>(out T)

    Try to get the value of a component type. Throws if component type is not in UsedComponents list.

    Declaration
    public bool TryGetComponent<T>(out T value) where T : IBuildComponent
    Parameters
    Type Name Description
    T value

    The component value.

    Returns
    Type Description
    bool

    true if the component 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)