Struct SimpleRumble | Package Manager UI website
docs.unity3d.com
    Show / Hide Table of Contents

    Struct SimpleRumble

    This class controls the intensity and state of a rumble motor on a single XR device.

    Inherited Members
    System.ValueType.Equals(System.Object)
    System.ValueType.GetHashCode()
    System.ValueType.ToString()
    System.Object.Equals(System.Object, System.Object)
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.GetType()
    Namespace: UnityEngine.Experimental.Input.Plugins.XR.Haptics
    Syntax
    public struct SimpleRumble

    Constructors

    SimpleRumble(InputDevice)

    Simple constructor that links this SimpleRumble class to a specific device.

    Declaration
    public SimpleRumble(InputDevice device)
    Parameters
    Type Name Description
    InputDevice device

    The XR device containing the rumble motor you want to link to.

    Properties

    intensity

    Determines the rumble intensity. This expects a 0-1 value, where 0 is off, and 1 is the maximum amplitude available to the device

    Declaration
    public float intensity { get; set; }
    Property Value
    Type Description
    System.Single

    isPaused

    This allows you to pause the actual device motors. This doesn't affect the current intensity, but prevents that intensity from being sent to the device.

    Declaration
    public bool isPaused { get; set; }
    Property Value
    Type Description
    System.Boolean

    isRumbling

    A quick accessor to verify that the intensity is greater than 0, and that the rumble motor is not paused.

    Declaration
    public bool isRumbling { get; }
    Property Value
    Type Description
    System.Boolean

    Methods

    Reset()

    Resets the rumble motor state to defaults, which is an intensity of 0 and unpaused.

    Declaration
    public void Reset()
    In This Article
    • Constructors
      • SimpleRumble(InputDevice)
    • Properties
      • intensity
      • isPaused
      • isRumbling
    • Methods
      • Reset()
    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