Class DpadControl | Package Manager UI website
docs.unity.cn
    Show / Hide Table of Contents

    Class DpadControl

    A control made up of four discrete, directional buttons. Forms a vector but can also be addressed as individual buttons.

    Inheritance
    System.Object
    InputControl
    InputControl<Vector2>
    DpadControl
    Inherited Members
    InputControl<Vector2>.valueType
    InputControl<Vector2>.valueSizeInBytes
    InputControl<Vector2>.ReadValue()
    InputControl<Vector2>.ReadValueFromPreviousFrame()
    InputControl<Vector2>.ReadDefaultValue()
    InputControl<Vector2>.ReadValueFromState(Void*)
    InputControl<Vector2>.ReadUnprocessedValue()
    InputControl<Vector2>.ReadValueFromStateAsObject(Void*)
    InputControl<Vector2>.ReadValueFromStateIntoBuffer(Void*, Void*, Int32)
    InputControl<Vector2>.WriteValueFromBufferIntoState(Void*, Int32, Void*)
    InputControl<Vector2>.WriteValueFromObjectIntoState(Object, Void*)
    InputControl<Vector2>.CompareValue(Void*, Void*)
    InputControl<Vector2>.ProcessValue(Vector2)
    InputControl.ReservedCharacters
    InputControl.name
    InputControl.displayName
    InputControl.shortDisplayName
    InputControl.path
    InputControl.layout
    InputControl.variants
    InputControl.device
    InputControl.parent
    InputControl.children
    InputControl.usages
    InputControl.aliases
    InputControl.stateBlock
    InputControl.noisy
    InputControl.synthetic
    InputControl.Item[String]
    InputControl.ToString()
    InputControl.EvaluateMagnitude()
    InputControl.EvaluateMagnitude(Void*)
    InputControl.CompareState(Void*, Void*, Void*)
    InputControl.TryGetChildControl(String)
    InputControl.RefreshConfigurationIfNeeded()
    InputControl.RefreshConfiguration()
    InputControl.m_StateBlock
    InputControl.currentStatePtr
    InputControl.previousFrameStatePtr
    InputControl.defaultStatePtr
    InputControl.noiseMaskPtr
    InputControl.stateOffsetRelativeToDeviceRoot
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    Namespace: UnityEngine.Experimental.Input.Controls
    Syntax
    public class DpadControl : InputControl<Vector2>
    Remarks

    Is stored as four bits by default.

    The vector that is aggregated from the button states is normalized. I.e. even if pressing diagonally, the vector will have a length of 1 (instead of reading something like (1,1) for example).

    Constructors

    DpadControl()

    Declaration
    public DpadControl()

    Properties

    down

    The button representing the vertical downwards state of the D-Pad.

    Declaration
    public ButtonControl down { get; }
    Property Value
    Type Description
    ButtonControl

    left

    The button representing the horizontal left state of the D-Pad.

    Declaration
    public ButtonControl left { get; }
    Property Value
    Type Description
    ButtonControl

    right

    The button representing the horizontal right state of the D-Pad.

    Declaration
    public ButtonControl right { get; }
    Property Value
    Type Description
    ButtonControl

    up

    The button representing the vertical upwards state of the D-Pad.

    Declaration
    public ButtonControl up { get; }
    Property Value
    Type Description
    ButtonControl

    Methods

    FinishSetup(InputDeviceBuilder)

    Declaration
    protected override void FinishSetup(InputDeviceBuilder builder)
    Parameters
    Type Name Description
    InputDeviceBuilder builder
    Overrides
    InputControl.FinishSetup(InputDeviceBuilder)

    MakeDpadVector(Boolean, Boolean, Boolean, Boolean, Boolean)

    Create a direction vector from the given four button states.

    Declaration
    public static Vector2 MakeDpadVector(bool up, bool down, bool left, bool right, bool normalize = true)
    Parameters
    Type Name Description
    System.Boolean up
    System.Boolean down
    System.Boolean left
    System.Boolean right
    System.Boolean normalize
    Returns
    Type Description
    Vector2

    A normalized 2D direction vector.

    ReadUnprocessedValueFromState(Void*)

    Declaration
    public override Vector2 ReadUnprocessedValueFromState(void *statePtr)
    Parameters
    Type Name Description
    System.Void* statePtr
    Returns
    Type Description
    Vector2
    Overrides
    UnityEngine.Experimental.Input.InputControl<Vector2>.ReadUnprocessedValueFromState(System.Void*)

    WriteValueIntoState(Vector2, Void*)

    Declaration
    public override void WriteValueIntoState(Vector2 value, void *statePtr)
    Parameters
    Type Name Description
    Vector2 value
    System.Void* statePtr
    Overrides
    UnityEngine.Experimental.Input.InputControl<Vector2>.WriteValueIntoState(Vector2, System.Void*)
    Back to top Copyright © 2015-2018 Unity
    Generated by DocFX