diff --git a/Packages/com.unity.inputsystem/CHANGELOG.md b/Packages/com.unity.inputsystem/CHANGELOG.md index b2ce776658..121f88796b 100644 --- a/Packages/com.unity.inputsystem/CHANGELOG.md +++ b/Packages/com.unity.inputsystem/CHANGELOG.md @@ -14,6 +14,7 @@ however, it has to be formatted properly to pass verification tests. - Fixed memory allocation on every frame when using UIDocument without EventSystem. [ISXB-953](https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-953) - Fixed Action Maps name edition which could be inconsistent in Input Action Editor UI. - Fixed InputDeviceTester sample only visualizing a given touch contact once. [ISXB-1017](https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-1017) +- Fixed Package compilation when Unity Analytics module is not enabled on 2022.3. [ISXB-996](https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-996) ### Added - Added Hinge Angle sensor support for foldable devices. diff --git a/Packages/com.unity.inputsystem/InputSystem/NativeInputRuntime.cs b/Packages/com.unity.inputsystem/InputSystem/NativeInputRuntime.cs index af5230a7d0..f82d5fa8b3 100644 --- a/Packages/com.unity.inputsystem/InputSystem/NativeInputRuntime.cs +++ b/Packages/com.unity.inputsystem/InputSystem/NativeInputRuntime.cs @@ -398,9 +398,12 @@ public void SendAnalytic(InputAnalytics.IInputAnalytic analytic) #if (UNITY_2023_2_OR_NEWER) EditorAnalytics.SendAnalytic(analytic); #else + // The preprocessor filtering is a workaround for the fact that the AnalyticsResult enum is not available before 2023.1.0a14 when not using the built-in Unity Analytics module. + #if UNITY_INPUT_SYSTEM_ENABLE_ANALYTICS || UNITY_2023_1_OR_NEWER var info = analytic.info; EditorAnalytics.RegisterEventWithLimit(info.Name, info.MaxEventsPerHour, info.MaxNumberOfElements, InputAnalytics.kVendorKey); EditorAnalytics.SendEventWithLimit(info.Name, analytic); + #endif // UNITY_INPUT_SYSTEM_ENABLE_ANALYTICS || UNITY_2023_1_OR_NEWER #endif // UNITY_2023_2_OR_NEWER #elif (UNITY_ANALYTICS) // Implicitly: !UNITY_EDITOR var info = analytic.info; diff --git a/Packages/com.unity.inputsystem/InputSystem/Unity.InputSystem.asmdef b/Packages/com.unity.inputsystem/InputSystem/Unity.InputSystem.asmdef index 5c22fadc32..d35fc93cc1 100644 --- a/Packages/com.unity.inputsystem/InputSystem/Unity.InputSystem.asmdef +++ b/Packages/com.unity.inputsystem/InputSystem/Unity.InputSystem.asmdef @@ -91,6 +91,11 @@ "name": "Unity", "expression": "6000.0.11", "define": "UNITY_INPUT_SYSTEM_INPUT_MODULE_SCROLL_DELTA" + }, + { + "name": "com.unity.modules.unityanalytics", + "expression": "1", + "define": "UNITY_INPUT_SYSTEM_ENABLE_ANALYTICS" } ], "noEngineReferences": false