Skip to content

Commit 491372f

Browse files
authored
FIX: ISXB-996 fixed Package compilation when Unity Analytics module is not enabled on 2022.3. (#1987)
* Fixed Package compilation when Unity Analytics module is not enabled on 2022.3.
1 parent ab2c3d7 commit 491372f

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

Packages/com.unity.inputsystem/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ however, it has to be formatted properly to pass verification tests.
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.
1616
- Fixed InputDeviceTester sample only visualizing a given touch contact once. [ISXB-1017](https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-1017)
17+
- 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)
1718

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

Packages/com.unity.inputsystem/InputSystem/NativeInputRuntime.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,9 +398,12 @@ public void SendAnalytic(InputAnalytics.IInputAnalytic analytic)
398398
#if (UNITY_2023_2_OR_NEWER)
399399
EditorAnalytics.SendAnalytic(analytic);
400400
#else
401+
// 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.
402+
#if UNITY_INPUT_SYSTEM_ENABLE_ANALYTICS || UNITY_2023_1_OR_NEWER
401403
var info = analytic.info;
402404
EditorAnalytics.RegisterEventWithLimit(info.Name, info.MaxEventsPerHour, info.MaxNumberOfElements, InputAnalytics.kVendorKey);
403405
EditorAnalytics.SendEventWithLimit(info.Name, analytic);
406+
#endif // UNITY_INPUT_SYSTEM_ENABLE_ANALYTICS || UNITY_2023_1_OR_NEWER
404407
#endif // UNITY_2023_2_OR_NEWER
405408
#elif (UNITY_ANALYTICS) // Implicitly: !UNITY_EDITOR
406409
var info = analytic.info;

Packages/com.unity.inputsystem/InputSystem/Unity.InputSystem.asmdef

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,11 @@
9191
"name": "Unity",
9292
"expression": "6000.0.11",
9393
"define": "UNITY_INPUT_SYSTEM_INPUT_MODULE_SCROLL_DELTA"
94+
},
95+
{
96+
"name": "com.unity.modules.unityanalytics",
97+
"expression": "1",
98+
"define": "UNITY_INPUT_SYSTEM_ENABLE_ANALYTICS"
9499
}
95100
],
96101
"noEngineReferences": false

0 commit comments

Comments
 (0)