Skip to content

Commit 0c1b0f0

Browse files
FIX: Input System 1.9.0 does not compile on Console Platforms (ISXB-963) (#1971)
* Avoid using Analytics module in platforms that don't have it Console platforms don't have this module so this code would break. * Improvement based on PR review
1 parent 628d91b commit 0c1b0f0

1 file changed

Lines changed: 8 additions & 7 deletions

File tree

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

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
using System.Reflection;
1010
using UnityEditor;
1111
using UnityEditorInternal;
12-
1312
#endif
1413

1514
// This should be the only file referencing the API at UnityEngineInternal.Input.
@@ -394,22 +393,24 @@ public Action onProjectChange
394393

395394
public void SendAnalytic(InputAnalytics.IInputAnalytic analytic)
396395
{
396+
#if ENABLE_CLOUD_SERVICES_ANALYTICS
397397
#if (UNITY_EDITOR)
398-
#if (UNITY_2023_2_OR_NEWER)
398+
#if (UNITY_2023_2_OR_NEWER)
399399
EditorAnalytics.SendAnalytic(analytic);
400-
#else
400+
#else
401401
var info = analytic.info;
402402
EditorAnalytics.RegisterEventWithLimit(info.Name, info.MaxEventsPerHour, info.MaxNumberOfElements, InputAnalytics.kVendorKey);
403403
EditorAnalytics.SendEventWithLimit(info.Name, analytic);
404-
#endif // UNITY_2023_2_OR_NEWER
405-
#elif UNITY_ANALYTICS // Implicitly: !UNITY_EDITOR
404+
#endif // UNITY_2023_2_OR_NEWER
405+
#elif (UNITY_ANALYTICS) // Implicitly: !UNITY_EDITOR
406406
var info = analytic.info;
407407
Analytics.Analytics.RegisterEvent(info.Name, info.MaxEventsPerHour, info.MaxNumberOfElements, InputAnalytics.kVendorKey);
408408
if (analytic.TryGatherData(out var data, out var error))
409409
Analytics.Analytics.SendEvent(info.Name, data);
410410
else
411-
Debug.Log(error); // Non fatal
412-
#endif // UNITY_EDITOR
411+
Debug.Log(error); // Non fatal
412+
#endif //UNITY_EDITOR
413+
#endif //ENABLE_CLOUD_SERVICES_ANALYTICS
413414
}
414415

415416
#endif // UNITY_ANALYTICS || UNITY_EDITOR

0 commit comments

Comments
 (0)