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

    Class DpadComposite

    A 2D planar motion vector computed from an up+down button pair and a left+right button pair.

    Inheritance
    System.Object
    InputBindingComposite<Vector2>
    DpadComposite
    Inherited Members
    InputBindingComposite<Vector2>.valueType
    InputBindingComposite<Vector2>.valueSizeInBytes
    InputBindingComposite<Vector2>.ReadValue(InputBindingCompositeContext, Void*, Int32)
    System.Object.ToString()
    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.Composites
    Syntax
    public class DpadComposite : InputBindingComposite<Vector2>, IInputBindingComposite<Vector2>, IInputBindingComposite
    Remarks

    This composite allows to grab arbitrary buttons from a device and arrange them in a D-Pad like configuration. Based on button presses, the composite will return a normalized direction vector.

    Opposing motions cancel each other out. Meaning that if, for example, both the left and right horizontal button are pressed, the resulting horizontal movement value will be zero.

    Fields

    down

    Declaration
    public int down
    Field Value
    Type Description
    System.Int32

    left

    Declaration
    public int left
    Field Value
    Type Description
    System.Int32

    normalize

    If true (default), then the resulting vector will be normalized. Otherwise, diagonal vectors will have a magnitude > 1.

    Declaration
    public bool normalize
    Field Value
    Type Description
    System.Boolean

    right

    Declaration
    public int right
    Field Value
    Type Description
    System.Int32

    up

    Declaration
    public int up
    Field Value
    Type Description
    System.Int32

    Methods

    ReadValue(ref InputBindingCompositeContext)

    Declaration
    public override Vector2 ReadValue(ref InputBindingCompositeContext context)
    Parameters
    Type Name Description
    InputBindingCompositeContext context
    Returns
    Type Description
    Vector2
    Overrides
    UnityEngine.Experimental.Input.InputBindingComposite<Vector2>.ReadValue(UnityEngine.Experimental.Input.InputBindingCompositeContext)
    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