docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Struct MyDeviceState

    Example state struct describing the memory layout of MyDevice.

    Implements
    IInputStateTypeInfo
    Inherited Members
    ValueType.Equals(object)
    ValueType.GetHashCode()
    ValueType.ToString()
    Namespace: DocCodeSamples.Tests
    Assembly: Unity.InputSystem.DocCodeSamples.dll
    Syntax
    public struct MyDeviceState : IInputStateTypeInfo

    Fields

    axis

    Raw state for the device's analog axis control.

    Declaration
    [InputControl(layout = "Analog", parameters = "clamp=true,clampMin=0,clampMax=1")]
    public float axis
    Field Value
    Type Description
    float

    buttons

    Bit-packed state for firstButton and secondButton.

    Declaration
    [InputControl(name = "firstButton", layout = "Button", bit = 0)]
    [InputControl(name = "secondButton", layout = "Button", bit = 1)]
    public int buttons
    Field Value
    Type Description
    int

    Properties

    format

    The memory format identifier for this state struct.

    Declaration
    public FourCC format { get; }
    Property Value
    Type Description
    FourCC

    Implements

    IInputStateTypeInfo
    In This Article
    Back to top
    Copyright © 2026 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)