Struct InputControlLayout.Builder | Package Manager UI website
docs.unity3d.com
    Show / Hide Table of Contents

    Struct InputControlLayout.Builder

    Build a layout programmatically. Primarily for use by layout builders registered with the system.

    Namespace: UnityEngine.InputSystem.Layouts
    Syntax
    public struct Builder

    Fields

    extendsLayout

    Declaration
    public string extendsLayout
    Field Value
    Type Description
    System.String

    name

    Declaration
    public string name
    Field Value
    Type Description
    System.String

    stateFormat

    Declaration
    public FourCC stateFormat
    Field Value
    Type Description
    FourCC

    type

    Declaration
    public Type type
    Field Value
    Type Description
    System.Type

    updateBeforeRender

    Declaration
    public bool? updateBeforeRender
    Field Value
    Type Description
    System.Nullable<System.Boolean>

    Properties

    controls

    Declaration
    public ReadOnlyArray<InputControlLayout.ControlItem> controls { get; }
    Property Value
    Type Description
    ReadOnlyArray<InputControlLayout.ControlItem>

    Methods

    AddControl(String)

    Add a new control to the layout.

    Declaration
    public InputControlLayout.Builder.ControlBuilder AddControl(string name)
    Parameters
    Type Name Description
    System.String name

    Name or path of the control. If it is a path (e.g. "leftStick/x", then the control either modifies the setup of a child control of another control in the layout or adds a new child control to another control in the layout. Modifying child control is useful, for example, to alter the state format of controls coming from the base layout. Likewise, adding child controls to another control is useful to modify the setup of of the control layout being used without having to create and register a custom control layout.

    Returns
    Type Description
    InputControlLayout.Builder.ControlBuilder

    A control builder that permits setting various parameters on the control.

    Exceptions
    Type Condition
    System.ArgumentException

    name is null or empty.

    Build()

    Declaration
    public InputControlLayout Build()
    Returns
    Type Description
    InputControlLayout

    Extend(String)

    Declaration
    public InputControlLayout.Builder Extend(string baseLayoutName)
    Parameters
    Type Name Description
    System.String baseLayoutName
    Returns
    Type Description
    InputControlLayout.Builder

    WithFormat(String)

    Declaration
    public InputControlLayout.Builder WithFormat(string format)
    Parameters
    Type Name Description
    System.String format
    Returns
    Type Description
    InputControlLayout.Builder

    WithFormat(FourCC)

    Declaration
    public InputControlLayout.Builder WithFormat(FourCC format)
    Parameters
    Type Name Description
    FourCC format
    Returns
    Type Description
    InputControlLayout.Builder

    WithName(String)

    Declaration
    public InputControlLayout.Builder WithName(string name)
    Parameters
    Type Name Description
    System.String name
    Returns
    Type Description
    InputControlLayout.Builder

    WithType<T>()

    Declaration
    public InputControlLayout.Builder WithType<T>()
        where T : InputControl
    Returns
    Type Description
    InputControlLayout.Builder
    Type Parameters
    Name Description
    T

    See Also

    RegisterLayoutBuilder(Expression<Func<InputControlLayout>>, String, String, Nullable<InputDeviceMatcher>)
    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023