Maze / Library /PackageCache /com.unity.inputsystem@1.6.1 /InputSystem /Plugins /DualShock /DualShockGamepad.cs
| using UnityEngine.InputSystem.Controls; | |
| using UnityEngine.InputSystem.Layouts; | |
| using UnityEngine.Scripting; | |
| ////TODO: speaker, touchpad | |
| ////TODO: move gyro here | |
| namespace UnityEngine.InputSystem.DualShock | |
| { | |
| /// <summary> | |
| /// A Sony DualShock/DualSense controller. | |
| /// </summary> | |
| [] | |
| public class DualShockGamepad : Gamepad, IDualShockHaptics | |
| { | |
| /// <summary> | |
| /// Button that is triggered when the touchbar on the controller is pressed down. | |
| /// </summary> | |
| /// <value>Control representing the touchbar button.</value> | |
| [] | |
| [] | |
| [] | |
| [] | |
| [] | |
| public ButtonControl touchpadButton { get; protected set; } | |
| /// <summary> | |
| /// The right side button in the middle section of the controller. Equivalent to | |
| /// <see cref="Gamepad.startButton"/>. | |
| /// </summary> | |
| /// <value>Same as <see cref="Gamepad.startButton"/>.</value> | |
| [] | |
| public ButtonControl optionsButton { get; protected set; } | |
| /// <summary> | |
| /// The left side button in the middle section of the controller. Equivalent to | |
| /// <see cref="Gamepad.selectButton"/> | |
| /// </summary> | |
| /// <value>Same as <see cref="Gamepad.selectButton"/>.</value> | |
| [] | |
| public ButtonControl shareButton { get; protected set; } | |
| /// <summary> | |
| /// The left shoulder button. | |
| /// </summary> | |
| /// <value>Equivalent to <see cref="Gamepad.leftShoulder"/>.</value> | |
| [] | |
| public ButtonControl L1 { get; protected set; } | |
| /// <summary> | |
| /// The right shoulder button. | |
| /// </summary> | |
| /// <value>Equivalent to <see cref="Gamepad.rightShoulder"/>.</value> | |
| [] | |
| public ButtonControl R1 { get; protected set; } | |
| /// <summary> | |
| /// The left trigger button. | |
| /// </summary> | |
| /// <value>Equivalent to <see cref="Gamepad.leftTrigger"/>.</value> | |
| [] | |
| public ButtonControl L2 { get; protected set; } | |
| /// <summary> | |
| /// The right trigger button. | |
| /// </summary> | |
| /// <value>Equivalent to <see cref="Gamepad.rightTrigger"/>.</value> | |
| [] | |
| public ButtonControl R2 { get; protected set; } | |
| /// <summary> | |
| /// The left stick press button. | |
| /// </summary> | |
| /// <value>Equivalent to <see cref="Gamepad.leftStickButton"/>.</value> | |
| [] | |
| public ButtonControl L3 { get; protected set; } | |
| /// <summary> | |
| /// The right stick press button. | |
| /// </summary> | |
| /// <value>Equivalent to <see cref="Gamepad.rightStickButton"/>.</value> | |
| [] | |
| public ButtonControl R3 { get; protected set; } | |
| /// <summary> | |
| /// The last used/added DualShock controller. | |
| /// </summary> | |
| public new static DualShockGamepad current { get; private set; } | |
| /// <inheritdoc /> | |
| public override void MakeCurrent() | |
| { | |
| base.MakeCurrent(); | |
| current = this; | |
| } | |
| /// <inheritdoc /> | |
| protected override void OnRemoved() | |
| { | |
| base.OnRemoved(); | |
| if (current == this) | |
| current = null; | |
| } | |
| /// <inheritdoc /> | |
| protected override void FinishSetup() | |
| { | |
| base.FinishSetup(); | |
| touchpadButton = GetChildControl<ButtonControl>("touchpadButton"); | |
| optionsButton = startButton; | |
| shareButton = selectButton; | |
| L1 = leftShoulder; | |
| R1 = rightShoulder; | |
| L2 = leftTrigger; | |
| R2 = rightTrigger; | |
| L3 = leftStickButton; | |
| R3 = rightStickButton; | |
| } | |
| /// <inheritdoc /> | |
| public virtual void SetLightBarColor(Color color) | |
| { | |
| } | |
| } | |
| } | |