Skip to content

Commit badaef8

Browse files
authored
NEW: Added analytics for Input Action Editor Session, Component Editor, Build/Settings (ISX-1546) (#1808)
* Refactored session analytics out of InputAnalytics into InputEditorAnalytics to make a clear cut between mixed and editor only types. * FIX: Due SettingsProvider bug in Unity focusController may be null due to incorrect function calls to Activate and Deactivate. Hence adding a null check to work around that problem. * NEW: Added analytics for settings. * FIX: Variable name shadowing causing compilation failure on Unity 2019. * FIX: Corrected code to compile correctly when Project-wide Input Actions are not available. * FIX: Corrected conditional compilation for Unity version supporting Project-wide Input Actions. * NEW: Added build GUID to build analytics top support group-by * NEW: Added component editor analytics * FIX: ISXB-930 InputActionVisualizer and InputControlVisualizer exception on entering play-mode
1 parent 78e4e0e commit badaef8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+2376
-121
lines changed

Assets/Samples/Visualizers/InputActionVisualizer.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,12 @@ protected void Update()
6363
{
6464
base.OnDisable();
6565

66-
s_EnabledInstances.Remove(this);
67-
if (s_EnabledInstances.Count == 0)
68-
InputSystem.onActionChange -= OnActionChange;
66+
if (s_EnabledInstances != null)
67+
{
68+
s_EnabledInstances.Remove(this);
69+
if (s_EnabledInstances.Count == 0)
70+
InputSystem.onActionChange -= OnActionChange;
71+
}
6972

7073
if (m_Visualization == Visualization.Interaction && m_Action != null)
7174
{

Assets/Samples/Visualizers/InputControlVisualizer.cs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,11 +102,14 @@ public int controlIndex
102102
if (m_Visualization == Mode.None)
103103
return;
104104

105-
s_EnabledInstances.Remove(this);
106-
if (s_EnabledInstances.Count == 0)
105+
if (s_EnabledInstances != null)
107106
{
108-
InputSystem.onDeviceChange -= OnDeviceChange;
109-
InputSystem.onEvent -= OnEvent;
107+
s_EnabledInstances.Remove(this);
108+
if (s_EnabledInstances.Count == 0)
109+
{
110+
InputSystem.onDeviceChange -= OnDeviceChange;
111+
InputSystem.onEvent -= OnEvent;
112+
}
110113
}
111114

112115
m_Control = null;

Assets/Tests/InputSystem.Editor/TestData.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
using UnityEngine;
55
using UnityEngine.InputSystem;
66
using UnityEngine.InputSystem.Editor;
7+
using InputAnalytics = UnityEngine.InputSystem.InputAnalytics;
78
using Random = UnityEngine.Random;
89

910
public static class TestData
@@ -33,11 +34,13 @@ public static class TestData
3334
});
3435

3536
internal static Generator<InputActionsEditorState> editorState =
36-
new(() => new InputActionsEditorState(new SerializedObject(ScriptableObject.CreateInstance<InputActionAsset>())));
37+
new(() => new InputActionsEditorState(
38+
new InputActionsEditorSessionAnalytic(InputActionsEditorSessionAnalytic.Data.Kind.EditorWindow),
39+
new SerializedObject(ScriptableObject.CreateInstance<InputActionAsset>())));
3740

3841
internal static Generator<InputActionsEditorState> EditorStateWithAsset(ScriptableObject asset)
3942
{
40-
return new Generator<InputActionsEditorState>(() => new InputActionsEditorState(new SerializedObject(asset)));
43+
return new Generator<InputActionsEditorState>(() => new InputActionsEditorState(null, new SerializedObject(asset)));
4144
}
4245

4346
public static Generator<InputControlScheme.DeviceRequirement> deviceRequirement =

Assets/Tests/InputSystem/CoreTests_Analytics.cs

Lines changed: 514 additions & 2 deletions
Large diffs are not rendered by default.

Packages/com.unity.inputsystem/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,17 @@ however, it has to be formatted properly to pass verification tests.
3535
- Fixed the UI generation of enum fields when editing interactions of action properties. The new selected value was lost when saving.
3636
- Fixed the UI generation of custom interactions of action properties when it rely on OnGUI callback. [ISXB-886](https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-886).
3737
- Fixed deletion of last composite part raising an exception. [ISXB-804](https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-804)
38+
- Fixed an issue related to Visualizers sample where exceptions would be thrown by InputActionVisualizer and InputControlVisualizer when entering play-mode if added as components to a new `GameObject`.
3839

3940
### Added
4041
- Added additional device information when logging the error due to exceeding the maximum number of events processed
4142
set by `InputSystem.settings.maxEventsBytesPerUpdate`. This additional information is available in development builds
4243
only.
44+
- Fixed deletion of last composite part raising an exception. [ISXB-804](https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-804)
45+
- Expanded editor and build insight analytics to cover ``.inputactions` asset editor usage, `InputSettings` and common component configurations.
46+
47+
### Changed
48+
- Changed `DualSenseHIDInputReport` from internal to public visibility
4349
- Added Input Setting option allowing to keep platform-specific scroll wheel input values instead of automatically converting them to a normalized range.
4450

4551
## [1.8.2] - 2024-04-29

Packages/com.unity.inputsystem/InputSystem/Editor/Analytics.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.

0 commit comments

Comments
 (0)