Skip to content

Commit c3da203

Browse files
authored
Merge branch 'develop' into isxb-711/fix-player-input-action-map-callback
2 parents 96d7284 + c756a5e commit c3da203

32 files changed

+938
-306
lines changed

Assets/Tests/InputSystem.Editor/InputActionsEditorTests.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ public void CanListActionMaps()
7171
}
7272

7373
[UnityTest]
74+
[Ignore("Instability, see ISXB-1284")]
7475
public IEnumerator CanCreateActionMap()
7576
{
7677
var button = m_Window.rootVisualElement.Q<Button>("add-new-action-map-button");
@@ -147,6 +148,7 @@ public IEnumerator CanRenameActionMap()
147148
}
148149

149150
[UnityTest]
151+
[Ignore("Instability, see ISXB-1284")]
150152
public IEnumerator CanDeleteActionMap()
151153
{
152154
var actionMapsContainer = m_Window.rootVisualElement.Q("action-maps-container");

Packages/com.unity.inputsystem/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ however, it has to be formatted properly to pass verification tests.
3030
- Fixed tooltip support in the UI Toolkit version of the Input Actions Asset editor.
3131
- Fixed documentation to clarify bindings with modifiers `overrideModifiersNeedToBePressedFirst` configuration [ISXB-806](https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-806).
3232
- Fixed an issue in `Samples/Visualizers/GamepadVisualizer.unity` sample where the visualization wouldn't handle device disconnects or current device changes properly (ISXB-1243).
33+
- Fixed an issue when displaying Serialized InputAction's Processor properties inside the Inspector window. [ISXB-1269](https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-1269)
34+
- Fixed an issue with default device selection when adding new Control Scheme.
3335
- Fixed an issue where action map delegates were not updated when the asset already assigned to the PlayerInput component were changed [ISXB-711](https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-711).
3436

3537
### Changed
@@ -38,6 +40,9 @@ however, it has to be formatted properly to pass verification tests.
3840
- Changed paremeter `overrideModifiersNeedToBePressedFirst` to obsolete for `ButtonWithOneModifier`, `ButtonWithTwoModifiers`, `OneModifierComposite` and `TwoModifiersComposite` in favour the new `modifiersOrder` parameter which is more explicit.
3941
- Changed `Samples/Visualizers/GamepadVisualizer.unity` to visualize the control values of the current device instead of the first device.
4042

43+
### Added
44+
- Added new API `InputSystem.settings.useIMGUIEditorForAssets` that should be used in custom `InputParameterEditor` that use both IMGUI and UI Toolkit.
45+
4146
## [1.11.2] - 2024-10-16
4247

4348
### Fixed

Packages/com.unity.inputsystem/DocCodeSamples.Tests.meta

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"name": "Unity.InputSystem.DocCodeSamples",
3+
"rootNamespace": "",
4+
"references": [
5+
"GUID:75469ad4d38634e559750d17036d5f7c"
6+
],
7+
"includePlatforms": [],
8+
"excludePlatforms": [],
9+
"allowUnsafeCode": false,
10+
"overrideReferences": true,
11+
"precompiledReferences": [],
12+
"autoReferenced": false,
13+
"defineConstraints": [],
14+
"versionDefines": [],
15+
"noEngineReferences": false
16+
}

Packages/com.unity.inputsystem/DocCodeSamples.Tests/DocCodeSamples.asmdef.meta

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
using UnityEngine;
2+
using UnityEngine.InputSystem;
3+
4+
namespace DocCodeSamples.Tests
5+
{
6+
internal class GamepadExample : MonoBehaviour
7+
{
8+
void Start()
9+
{
10+
// Print all connected gamepads
11+
Debug.Log(string.Join("\n", Gamepad.all));
12+
}
13+
14+
void Update()
15+
{
16+
var gamepad = Gamepad.current;
17+
18+
// No gamepad connected.
19+
if (gamepad == null)
20+
{
21+
return;
22+
}
23+
24+
// Check if "Button North" was pressed this frame
25+
if (gamepad.buttonNorth.wasPressedThisFrame)
26+
{
27+
Debug.Log("Button North was pressed");
28+
}
29+
30+
// Check if the button control is being continuously actuated and read its value
31+
if (gamepad.rightTrigger.IsActuated())
32+
{
33+
Debug.Log("Right trigger value: " + gamepad.rightTrigger.ReadValue());
34+
}
35+
36+
// Read left stick value and perform some code based on the value
37+
Vector2 move = gamepad.leftStick.ReadValue();
38+
{
39+
// Use the Vector2 move for the game logic here
40+
}
41+
42+
// Creating haptic feedback while "Button South" is pressed and stopping it when released.
43+
if (gamepad.buttonSouth.wasPressedThisFrame)
44+
{
45+
gamepad.SetMotorSpeeds(0.2f, 1.0f);
46+
}
47+
else if (gamepad.buttonSouth.wasReleasedThisFrame)
48+
{
49+
gamepad.ResetHaptics();
50+
}
51+
}
52+
}
53+
}

Packages/com.unity.inputsystem/DocCodeSamples.Tests/GamepadExample.cs.meta

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
using UnityEngine;
2+
using UnityEngine.InputSystem;
3+
4+
namespace DocCodeSamples.Tests
5+
{
6+
internal class GamepadHapticsExample : MonoBehaviour
7+
{
8+
bool hapticsArePaused = false;
9+
10+
void Update()
11+
{
12+
var gamepad = Gamepad.current;
13+
14+
// No gamepad connected, no need to continue.
15+
if (gamepad == null)
16+
return;
17+
18+
float leftTrigger = gamepad.leftTrigger.ReadValue();
19+
float rightTrigger = gamepad.rightTrigger.ReadValue();
20+
21+
// Only set motor speeds if haptics were not paused and if trigger is actuated.
22+
// Both triggers must be actuated past 0.2f to start haptics.
23+
if (!hapticsArePaused &&
24+
(gamepad.leftTrigger.IsActuated() || gamepad.rightTrigger.IsActuated()))
25+
gamepad.SetMotorSpeeds(
26+
leftTrigger < 0.2f ? 0.0f : leftTrigger,
27+
rightTrigger < 0.2f ? 0.0f : rightTrigger);
28+
29+
// Toggle haptics "playback" when "Button South" is pressed.
30+
// Notice that if you release the triggers after pausing,
31+
// and press the button again, haptics will resume.
32+
if (gamepad.buttonSouth.wasPressedThisFrame)
33+
{
34+
if (hapticsArePaused)
35+
gamepad.ResumeHaptics();
36+
else
37+
gamepad.PauseHaptics();
38+
39+
hapticsArePaused = !hapticsArePaused;
40+
}
41+
42+
// Notice that if you release the triggers after pausing,
43+
// and press the Start button, haptics will be reset.
44+
if (gamepad.startButton.wasPressedThisFrame)
45+
gamepad.ResetHaptics();
46+
}
47+
}
48+
}

Packages/com.unity.inputsystem/DocCodeSamples.Tests/GamepadHapticsExample.cs.meta

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Packages/com.unity.inputsystem/InputSystem/Actions/Composites/AxisComposite.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ internal class AxisCompositeEditor : InputParameterEditor<AxisComposite>
220220
public override void OnGUI()
221221
{
222222
#if UNITY_INPUT_SYSTEM_PROJECT_WIDE_ACTIONS
223-
if (!InputSystem.settings.IsFeatureEnabled(InputFeatureNames.kUseIMGUIEditorForAssets)) return;
223+
if (!InputSystem.settings.useIMGUIEditorForAssets) return;
224224
#endif
225225
target.whichSideWins = (AxisComposite.WhichSideWins)EditorGUILayout.EnumPopup(m_WhichAxisWinsLabel, target.whichSideWins);
226226
}

0 commit comments

Comments
 (0)