Skip to content

Commit cf28d7d

Browse files
timkeoPauliusd01
andauthored
FIX: InputDeviceTester only shows first touch contact (IXSB-1017) (#1985)
The logic checking for duplicate "Began" phases with a touch contact was incorrect and has been corrected. Co-authored-by: Paulius Dervinis <54306142+Pauliusd01@users.noreply.github.com>
1 parent 730bb23 commit cf28d7d

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

  • ExternalSampleProjects/InputDeviceTester/Assets/InputDeviceTester/Scripts/Input
  • Packages/com.unity.inputsystem

ExternalSampleProjects/InputDeviceTester/Assets/InputDeviceTester/Scripts/Input/TouchISX.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,8 @@ private void NewTouchInput(TouchControl control)
8484
int id = control.touchId.ReadValue();
8585

8686
// Sometimes the Began phase is detected twice. The redundant one needs to be filtered out
87-
if (m_HighlightPool.Find(id.ToString()) != null) return;
87+
if (m_HighlightPool.Find(id.ToString())?.gameObject?.activeSelf ?? false)
88+
return;
8889

8990
Vector2 pos = Camera.main.ScreenToWorldPoint(control.position.ReadValue());
9091

Packages/com.unity.inputsystem/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ however, it has to be formatted properly to pass verification tests.
1313
### Fixed
1414
- Fixed memory allocation on every frame when using UIDocument without EventSystem. [ISXB-953](https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-953)
1515
- Fixed Action Maps name edition which could be inconsistent in Input Action Editor UI.
16+
- Fixed InputDeviceTester sample only visualizing a given touch contact once. [ISXB-1017](https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-1017)
1617

1718
### Added
1819
- Added Hinge Angle sensor support for foldable devices.

0 commit comments

Comments
 (0)