Class DualShockGamepad
A Sony DualShock controller.
Inherited Members
Namespace: UnityEngine.InputSystem.DualShock
Syntax
public class DualShockGamepad : Gamepad, IDualShockHaptics, IDualMotorRumble, IHaptics
Properties
current
The last used/added DualShock controller.
Declaration
public static DualShockGamepad current { get; }
Property Value
Type | Description |
---|---|
DualShockGamepad |
L1
The left shoulder button.
Declaration
public ButtonControl L1 { get; protected set; }
Property Value
Type | Description |
---|---|
ButtonControl | Equivalent to leftShoulder. |
L2
The left trigger button.
Declaration
public ButtonControl L2 { get; protected set; }
Property Value
Type | Description |
---|---|
ButtonControl | Equivalent to leftTrigger. |
L3
The left stick press button.
Declaration
public ButtonControl L3 { get; protected set; }
Property Value
Type | Description |
---|---|
ButtonControl | Equivalent to leftStickButton. |
optionsButton
The right side button in the middle section of the controller. Equivalent to startButton.
Declaration
public ButtonControl optionsButton { get; protected set; }
Property Value
Type | Description |
---|---|
ButtonControl | Same as startButton. |
R1
The right shoulder button.
Declaration
public ButtonControl R1 { get; protected set; }
Property Value
Type | Description |
---|---|
ButtonControl | Equivalent to rightShoulder. |
R2
The right trigger button.
Declaration
public ButtonControl R2 { get; protected set; }
Property Value
Type | Description |
---|---|
ButtonControl | Equivalent to rightTrigger. |
R3
The right stick press button.
Declaration
public ButtonControl R3 { get; protected set; }
Property Value
Type | Description |
---|---|
ButtonControl | Equivalent to rightStickButton. |
shareButton
The left side button in the middle section of the controller. Equivalent to selectButton
Declaration
public ButtonControl shareButton { get; protected set; }
Property Value
Type | Description |
---|---|
ButtonControl | Same as selectButton. |
touchpadButton
Button that is triggered when the touchbar on the controller is pressed down.
Declaration
public ButtonControl touchpadButton { get; protected set; }
Property Value
Type | Description |
---|---|
ButtonControl | Control representing the touchbar button. |
Methods
FinishSetup()
Perform final initialization tasks after the control hierarchy has been put into place.
Declaration
protected override void FinishSetup()
Overrides
Remarks
This method can be overridden to perform control- or device-specific setup work. The most common use case is for looking up child controls and storing them in local getters.
public class MyDevice : InputDevice
{
public ButtonControl button { get; private set; }
public AxisControl axis { get; private set; }
protected override void OnFinishSetup()
{
// Cache controls in getters.
button = GetChildControl("button");
axis = GetChildControl("axis");
}
}
MakeCurrent()
Make the gamepad the current gamepad.
Declaration
public override void MakeCurrent()
Overrides
Remarks
This is called automatically by the system when there is input on a gamepad.
OnRemoved()
Called when the gamepad is removed from the system.
Declaration
protected override void OnRemoved()
Overrides
SetLightBarColor(Color)
Set the color of the light bar on the back of the controller.
Declaration
public virtual void SetLightBarColor(Color color)
Parameters
Type | Name | Description |
---|---|---|
Color | color | Color to use for the light bar. Alpha component is ignored. Also, RBG values are clamped into [0..1] range. |