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

    Class InputDeviceBuilder

    Turns a device layout into an actual InputDevice instance.

    Inheritance
    System.Object
    InputDeviceBuilder
    Namespace: UnityEngine.InputSystem.Layouts
    Syntax
    public class InputDeviceBuilder
    Remarks

    Ultimately produces a device but can also be used to query the control setup described by a layout.

    Can be used both to create control hierarchies from scratch as well as to re-create or change existing hierarchies.

    InputDeviceBuilder is the only way to create control hierarchies. InputControls cannot be new'd directly.

    Also computes a final state layout when setup is finished.

    Note that InputDeviceBuilders generate garbage. They are meant to be used for initialization only. Don't use them during normal gameplay.

    Running an existing device through another control build is a destructive operation. Existing controls may be reused while at the same time the hierarchy and even the device instance itself may change.

    Constructors

    InputDeviceBuilder(String, String, InputDeviceDescription, InputDevice)

    Declaration
    public InputDeviceBuilder(string layout, string variants = null, InputDeviceDescription deviceDescription = default(InputDeviceDescription), InputDevice existingDevice = null)
    Parameters
    Type Name Description
    System.String layout
    System.String variants
    InputDeviceDescription deviceDescription
    InputDevice existingDevice

    Methods

    Finish()

    Declaration
    public InputDevice Finish()
    Returns
    Type Description
    InputDevice

    GetControl(String)

    Declaration
    public InputControl GetControl(string path)
    Parameters
    Type Name Description
    System.String path
    Returns
    Type Description
    InputControl

    GetControl(InputControl, String)

    Declaration
    public InputControl GetControl(InputControl parent, string path)
    Parameters
    Type Name Description
    InputControl parent
    System.String path
    Returns
    Type Description
    InputControl

    GetControl<TControl>(String)

    Declaration
    public TControl GetControl<TControl>(string path)
        where TControl : InputControl
    Parameters
    Type Name Description
    System.String path
    Returns
    Type Description
    TControl
    Type Parameters
    Name Description
    TControl

    GetControl<TControl>(InputControl, String)

    Declaration
    public TControl GetControl<TControl>(InputControl parent, string path)
        where TControl : InputControl
    Parameters
    Type Name Description
    InputControl parent
    System.String path
    Returns
    Type Description
    TControl
    Type Parameters
    Name Description
    TControl

    TryGetControl(String)

    Declaration
    public InputControl TryGetControl(string path)
    Parameters
    Type Name Description
    System.String path
    Returns
    Type Description
    InputControl

    TryGetControl(InputControl, String)

    Declaration
    public InputControl TryGetControl(InputControl parent, string path)
    Parameters
    Type Name Description
    InputControl parent
    System.String path
    Returns
    Type Description
    InputControl

    TryGetControl<TControl>(String)

    Declaration
    public TControl TryGetControl<TControl>(string path)
        where TControl : InputControl
    Parameters
    Type Name Description
    System.String path
    Returns
    Type Description
    TControl
    Type Parameters
    Name Description
    TControl

    TryGetControl<TControl>(InputControl, String)

    Declaration
    public TControl TryGetControl<TControl>(InputControl parent, string path)
        where TControl : InputControl
    Parameters
    Type Name Description
    InputControl parent
    System.String path
    Returns
    Type Description
    TControl
    Type Parameters
    Name Description
    TControl
    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