docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method GetOptionalComponent

    GetOptionalComponent(BuildContext, Type)

    Get the value of an optional Type component from BuildConfiguration. The component Type must exist in the OptionalComponents list. If the component is not found in BuildConfiguration, a new instance of type Type is returned.

    Declaration
    public IBuildComponent GetOptionalComponent(BuildContext context, Type type)
    Parameters
    Type Name Description
    BuildContext context

    The BuildContext used by the execution of this BuildStep.

    Type type

    Type of the optional component.

    Returns
    Type Description
    IBuildComponent

    The value of the optional component.

    GetOptionalComponent<T>(BuildContext)

    Get the value of an optional T component from BuildConfiguration. The component Type must exist in the OptionalComponents list. If the component is not found in BuildConfiguration, a new instance of type T is returned.

    Declaration
    public T GetOptionalComponent<T>(BuildContext context) where T : IBuildComponent
    Parameters
    Type Name Description
    BuildContext context

    The BuildContext used by the execution of this BuildStep.

    Returns
    Type Description
    T

    The value of the optional component.

    Type Parameters
    Name Description
    T

    Type of the optional 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)