-
Notifications
You must be signed in to change notification settings - Fork 303
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
Input Action Editor Session Analytics Support + Refactor (ISX-1546) #1808
base: develop
Are you sure you want to change the base?
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 |
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.
Seems like a reasonable update. A couple of minor questions.
…lytics to make a clear cut between mixed and editor only types.
Adding new actions in the input actions window still throws this error (not sure if I was supposed to check yet, checked on #660a74d. Ignore me if I'm checking too early):
|
This have now been addressed/fixed. |
You are absolutely right it seems, this used to work, so guess I have accidentally reverted it at some point. Will fix and ping you back. |
This should now be fixed |
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.
Nice work, good to know we will be able to see some statistics for the UITK editor soon!
I will have to look deeper into this - just a few comments to start with.
public enum Kind | ||
{ | ||
Invalid = 0, | ||
FreeFloatingEditorWindow = 1, |
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.
does that describe the editor that is opened from a custom created asset? It sounds a bit like this is a window that is not attached to any area in the editor but rather lays in another new window.
@@ -112,6 +118,7 @@ private static InputActionsEditorWindow GetOrCreateWindow(int id, out bool isAlr | |||
isAlreadyOpened = false; | |||
if (HasOpenInstances<InputActionsEditorWindow>()) | |||
{ | |||
// TODO Would need to reset analytics here?! |
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.
TODO comment
NullReferenceException thrown when adding actions/maps to ProjectWideActions and immediately closing the window: |
…e to incorrect function calls to Activate and Deactivate. Hence adding a null check to work around that problem.
Thanks for finding this. Its due to a bug in Unity SettingsProvider calls exposing a null-reference situation that should never happen. I have added a null check to avoid it so should be "fixed" now. |
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. Mainly only tested for any broken functionality in custom input action assets, projectwideactions, few sample scenes
Good to hear. Pulling this back into work-in-progress since I am adding additional analytics into the mix after recent decisions to also track workflows. |
# Conflicts: # Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/Commands/Commands.cs # Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/Commands/ControlSchemeCommands.cs # Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/InputActionsEditorSettingsProvider.cs # Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/InputActionsEditorState.cs # Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/InputActionsEditorWindow.cs
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.
Changes made
InputActionsEditorSessionData
which contains the raw analytic metric fields and documentation.InputAnalytics.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.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
.