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

    Class InputControlLayout.Builder

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

    Inheritance
    System.Object
    InputControlLayout.Builder
    Namespace: UnityEngine.InputSystem.Layouts
    Syntax
    public class Builder

    Properties

    controls

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

    displayName

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

    extendsLayout

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

    name

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

    stateFormat

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

    stateSizeInBytes

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

    type

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

    updateBeforeRender

    Declaration
    public bool? updateBeforeRender { get; set; }
    Property Value
    Type Description
    System.Nullable<System.Boolean>

    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

    WithDisplayName(String)

    Declaration
    public InputControlLayout.Builder WithDisplayName(string displayName)
    Parameters
    Type Name Description
    System.String displayName
    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

    WithSizeInBytes(Int32)

    Declaration
    public InputControlLayout.Builder WithSizeInBytes(int sizeInBytes)
    Parameters
    Type Name Description
    System.Int32 sizeInBytes
    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