-
Notifications
You must be signed in to change notification settings - Fork 328
CHANGE: Input Action Editor Session, Component Editor, Build/Settings Analytics Support + Refactor (ISX-1546) #1808
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…put action asset editors
# Conflicts: # Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/InputActionsEditorSettingsProvider.cs # Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/InputActionsEditorWindow.cs
# Conflicts: # Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/InputActionsEditorSettingsProvider.cs # Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/InputActionsEditorWindowUtils.cs
One problem with this PR/branch is that I noticed formatter fails on InputAnalytics.cs with issue relating to matching an opening bracket early in the file. Not sure why this is, if someone spots the error that I fail to find it would be very helpful. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Failures in CI need to be looked at and this also introduces errors when adding new maps and actions in the custom action asset window.
For example:
NullReferenceException: Object reference not set to an instance of an object
UnityEngine.InputSystem.Editor.Commands+<>c.<AddActionMap>b__2_0 (UnityEngine.InputSystem.Editor.InputActionsEditorState& state) (at ./Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/Commands/Commands.cs:33)
UnityEngine.InputSystem.Editor.StateContainer.Dispatch (UnityEngine.InputSystem.Editor.Command command) (at ./Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/StateContainer.cs:35)
UnityEngine.InputSystem.Editor.ViewBase`1[TViewState].Dispatch (UnityEngine.InputSystem.Editor.Command command) (at ./Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/Views/ViewBase.cs:70)
UnityEngine.InputSystem.Editor.ActionMapsView.AddActionMap () (at ./Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/Views/ActionMapsView.cs:113)
UnityEngine.UIElements.Clickable.Invoke (UnityEngine.UIElements.EventBase evt) (at D:/Gitrepo/unity/Modules/UIElements/Core/Clickable.cs:245)
UnityEngine.UIElements.Clickable.ProcessUpEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.Vector2 localPosition, System.Int32 pointerId) (at D:/Gitrepo/unity/Modules/UIElements/Core/Clickable.cs:342)
UnityEngine.UIElements.Clickable.OnPointerUp (UnityEngine.UIElements.PointerUpEvent evt) (at D:/Gitrepo/unity/Modules/UIElements/Core/Clickable.cs:209)
UnityEngine.UIElements.EventCallbackFunctor`1[TEventType].Invoke (UnityEngine.UIElements.EventBase evt) (at D:/Gitrepo/unity/Modules/UIElements/Core/Events/EventCallback.cs:64)
UnityEngine.UIElements.EventCallbackRegistry+DynamicCallbackList.Invoke (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.BaseVisualElementPanel panel, UnityEngine.UIElements.VisualElement target) (at D:/Gitrepo/unity/Modules/UIElements/Core/Events/EventCallbackRegistry.cs:228)
UnityEngine.UIElements.EventDispatchUtilities.HandleEventAcrossPropagationPathWithCompatibilityEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.EventBase compatibilityEvt, UnityEngine.UIElements.BaseVisualElementPanel panel, UnityEngine.UIElements.VisualElement target, System.Boolean isCapturingTarget) (at D:/Gitrepo/unity/Modules/UIElements/Core/Events/EventDispatchUtilities.cs:310)
UnityEngine.UIElements.EventDispatchUtilities.DispatchToCapturingElementOrElementUnderPointer (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.BaseVisualElementPanel panel, System.Int32 pointerId, UnityEngine.Vector2 position) (at D:/Gitrepo/unity/Modules/UIElements/Core/Events/EventDispatchUtilities.cs:578)
UnityEngine.UIElements.PointerEventBase`1[T].Dispatch (UnityEngine.UIElements.BaseVisualElementPanel panel) (at D:/Gitrepo/unity/Modules/UIElements/Core/Events/PointerEvents.cs:1180)
UnityEngine.UIElements.EventDispatcher.ProcessEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.BaseVisualElementPanel panel) (at D:/Gitrepo/unity/Modules/UIElements/Core/EventDispatcher.cs:336)
UnityEngine.UIElements.EventDispatcher.Dispatch (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.BaseVisualElementPanel panel, UnityEngine.UIElements.DispatchMode dispatchMode) (at D:/Gitrepo/unity/Modules/UIElements/Core/EventDispatcher.cs:200)
UnityEngine.UIElements.BaseVisualElementPanel.SendEvent (UnityEngine.UIElements.EventBase e, UnityEngine.UIElements.DispatchMode dispatchMode) (at D:/Gitrepo/unity/Modules/UIElements/Core/Panel.cs:625)
UnityEngine.UIElements.UIElementsUtility.DoDispatch (UnityEngine.UIElements.BaseVisualElementPanel panel) (at D:/Gitrepo/unity/Modules/UIElements/Core/UIElementsUtility.cs:506)
UnityEngine.UIElements.UIElementsUtility.UnityEngine.UIElements.IUIElementsUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr, System.Boolean& eventHandled) (at D:/Gitrepo/unity/Modules/UIElements/Core/UIElementsUtility.cs:225)
UnityEngine.UIElements.UIEventRegistration.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at D:/Gitrepo/unity/Modules/UIElements/Core/UIElementsUtility.cs:74)
UnityEngine.UIElements.UIEventRegistration+<>c.<.cctor>b__1_2 (System.Int32 i, System.IntPtr ptr) (at D:/Gitrepo/unity/Modules/UIElements/Core/UIElementsUtility.cs:28)
UnityEngine.GUIUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr, System.Boolean& result) (at D:/Gitrepo/unity/Modules/IMGUI/GUIUtility.cs:206)
Thanks @Pauliusd01 I'll check and follow-up with additional changes |
…l hashcodes due to lack of HashCode
…nputSystem into isxb-1546-analytics
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like there is one line that needs fixing
Packages/com.unity.inputsystem/InputSystem/Plugins/PlayerInput/PlayerInputEditor.cs
Outdated
Show resolved
Hide resolved
Packages/com.unity.inputsystem/InputSystem/Editor/InputEditorAnalytics.cs
Outdated
Show resolved
Hide resolved
…nputSystem into isxb-1546-analytics
…o actually instantiate editors to get indirect test case triggers instead of explicit.
…hecking for changes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the field fix - follow on tidy ups look reasonable.
All associated events have been verified to be received in backend. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, checked the basic input actions window functionality that was throwing errors before, most of the sample scene functionality and checked analytics using the internal testing package
Description
This PR introduces Unity Editor analytics support for getting insight into Input Action editor engagement and usage. Analytics have been designed to enable differentiation between an editor embedded into Project Settings (Project-wide actions) as well as a free-floating asset based editor, but otherwise be comparable. The analytics currently only track engagement on a high-level without being specific about specific user actions. Defined metrics are tracked via associated DASD ticket, see ISX-1546 for reference.
Note that this PR has been marked as a CHANGE instead of NEW since it doesn't introduce new user features.
Changes made
Added new class
InputActionsEditorSessionAnalytic
acting as a proxy object aroundInputActionsEditorSessionData
to provide abstraction around counting operations to prevent direct access and possible related mistakes in code providing metrics. The purpose of this class is to track and report analytics related to .inputactions asset editor windows.Added new classes to track editor (Inspector) editor changes for the following components:
PlayerInputEditorAnalytic
tracking selected changes to configuration ofPlayerInput
.PlayerInputManagerEditorAnalytic
tracking selected changes to configuration ofPlayerInputManager
.OnScreenStickEditorAnalytic
tracking selected changes to configuration ofOnScreenStick
.VirtualMouseInput
tracking selected changes to configuration ofVirtualMouseInput
Added new class
InputComponentEditorAnalytic
tracking statistics of how often an Inspector with the associated component editor is displayed for the following components:PlayerInput
PlayerInputManager
OnScreenStick
OnScreenButton
VirtualMouseInput
TouchSimulation
StandaloneInputModule
InputSystemUIInputModule
Added new class
InputBuildAnalytic
that reports statistics on settings when a project is being built. Currently all InputSettings are being logged, see associated spreadsheet (via internal ticket) for details.Other changes
UnityEngine.Analytics.IAnalytic.IData
when compiled on Unity 2023.2 or later and otherwise use legacy setup for analytics. This is achieved by conditionally defining the new IInputAnalytic to either derive from the new IAnalytic or to define a similar interface. This simplifies test and usage code.IInputRuntime
interface and derived classes NativeInputRuntime and InputTestRuntime.NativeInputRuntime
since previously did not send analytics unlessUNITY_ANALYTICS
was defined, but this do not seem to be defined in editor anyway. Any insight into this from reviewers would be useful.UnityEngine.Analytics.IAnalytic.IData
when compiled on Unity 2023.2 or later and otherwise use legacy setup for analytics.Notes
Development guidelines for how to integrate editor analytics and test them are linked form the internal ISX ticket.
This PR do not introduce analytics for legacy IMGUI editor. If this is needed additional work is needed to setup corresponding hooks for that editor.
This PR can be reviewed and tested as is but should likely not be merged until verified with help of backend engineers so it doesn't introduce regressions for existing analytics and to verify that new analytics are correct.
Checklist
Before review:
Changed
,Fixed
,Added
sections.([case %number%](https://issuetracker.unity3d.com/issues/...))
.CoreTests_Analytics.cs
During merge:
NEW: ___
.FIX: ___
.DOCS: ___
.CHANGE: ___
.RELEASE: 1.1.0-preview.3
.