docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class InputControlLayout.Builder

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

    Inheritance
    object
    InputControlLayout.Builder
    Namespace: UnityEngine.InputSystem.Layouts
    Assembly: Unity.InputSystem.dll
    Syntax
    public class InputControlLayout.Builder

    Properties

    controls

    List of control items set up by the layout.

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

    Controls set up by the layout.

    See Also
    AddControl(string)

    displayName

    Display name to assign to the layout.

    Declaration
    public string displayName { get; set; }
    Property Value
    Type Description
    string

    Display name to assign to the layout

    See Also
    displayName

    extendsLayout

    Which layout to base this layout on.

    Declaration
    public string extendsLayout { get; set; }
    Property Value
    Type Description
    string

    Name of base layout.

    See Also
    baseLayouts

    name

    Name to assign to the layout.

    Declaration
    public string name { get; set; }
    Property Value
    Type Description
    string

    Name to assign to the layout.

    See Also
    name

    stateFormat

    Memory format FourCC code to apply to state memory used by the layout.

    Declaration
    public FourCC stateFormat { get; set; }
    Property Value
    Type Description
    FourCC

    FourCC memory format tag.

    See Also
    stateFormat
    format

    stateSizeInBytes

    Total size of memory used by the layout.

    Declaration
    public int stateSizeInBytes { get; set; }
    Property Value
    Type Description
    int

    Size of memory used by the layout.

    See Also
    stateSizeInBytes

    type

    InputControl type to instantiate for the layout.

    Declaration
    public Type type { get; set; }
    Property Value
    Type Description
    Type

    Control type to instantiate for the layout.

    See Also
    type

    updateBeforeRender

    For device layouts, whether the device wants an extra update before rendering.

    Declaration
    public bool? updateBeforeRender { get; set; }
    Property Value
    Type Description
    bool?

    True if before-render updates should be enabled for the device.

    See Also
    updateBeforeRender
    updateBeforeRender

    Methods

    AddControl(string)

    Add a new control to the layout.

    Declaration
    public InputControlLayout.Builder.ControlBuilder AddControl(string name)
    Parameters
    Type Name Description
    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
    ArgumentException

    name is null or empty.

    See Also
    RegisterLayoutBuilder(Func<InputControlLayout>, string, string, InputDeviceMatcher?)

    Build()

    Declaration
    public InputControlLayout Build()
    Returns
    Type Description
    InputControlLayout
    See Also
    RegisterLayoutBuilder(Func<InputControlLayout>, string, string, InputDeviceMatcher?)

    Extend(string)

    Declaration
    public InputControlLayout.Builder Extend(string baseLayoutName)
    Parameters
    Type Name Description
    string baseLayoutName
    Returns
    Type Description
    InputControlLayout.Builder
    See Also
    RegisterLayoutBuilder(Func<InputControlLayout>, string, string, InputDeviceMatcher?)

    WithDisplayName(string)

    Declaration
    public InputControlLayout.Builder WithDisplayName(string displayName)
    Parameters
    Type Name Description
    string displayName
    Returns
    Type Description
    InputControlLayout.Builder
    See Also
    RegisterLayoutBuilder(Func<InputControlLayout>, string, string, InputDeviceMatcher?)

    WithFormat(string)

    Declaration
    public InputControlLayout.Builder WithFormat(string format)
    Parameters
    Type Name Description
    string format
    Returns
    Type Description
    InputControlLayout.Builder
    See Also
    RegisterLayoutBuilder(Func<InputControlLayout>, string, string, InputDeviceMatcher?)

    WithFormat(FourCC)

    Declaration
    public InputControlLayout.Builder WithFormat(FourCC format)
    Parameters
    Type Name Description
    FourCC format
    Returns
    Type Description
    InputControlLayout.Builder
    See Also
    RegisterLayoutBuilder(Func<InputControlLayout>, string, string, InputDeviceMatcher?)

    WithName(string)

    Declaration
    public InputControlLayout.Builder WithName(string name)
    Parameters
    Type Name Description
    string name
    Returns
    Type Description
    InputControlLayout.Builder
    See Also
    RegisterLayoutBuilder(Func<InputControlLayout>, string, string, InputDeviceMatcher?)

    WithSizeInBytes(int)

    Declaration
    public InputControlLayout.Builder WithSizeInBytes(int sizeInBytes)
    Parameters
    Type Name Description
    int sizeInBytes
    Returns
    Type Description
    InputControlLayout.Builder
    See Also
    RegisterLayoutBuilder(Func<InputControlLayout>, string, string, InputDeviceMatcher?)

    WithType<T>()

    Declaration
    public InputControlLayout.Builder WithType<T>() where T : InputControl
    Returns
    Type Description
    InputControlLayout.Builder
    Type Parameters
    Name Description
    T
    See Also
    RegisterLayoutBuilder(Func<InputControlLayout>, string, string, InputDeviceMatcher?)

    See Also

    RegisterLayoutBuilder(Func<InputControlLayout>, string, string, InputDeviceMatcher?)
    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)