-
Notifications
You must be signed in to change notification settings - Fork 328
FIX: Narrowing scope of ENABLE_CLOUD_SERVICES_ANALYTICS #1991
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
Changes from 5 commits
8fc32a8
8c0cbd0
90dfc1e
418c6cb
1b697ee
b6ab42e
aa54349
1c12e65
69cc757
43a5775
81fbd7c
4be0f1c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -393,7 +393,6 @@ public Action onProjectChange | |
|
||
public void SendAnalytic(InputAnalytics.IInputAnalytic analytic) | ||
{ | ||
#if ENABLE_CLOUD_SERVICES_ANALYTICS | ||
#if (UNITY_EDITOR) | ||
#if (UNITY_2023_2_OR_NEWER) | ||
EditorAnalytics.SendAnalytic(analytic); | ||
|
@@ -405,15 +404,14 @@ public void SendAnalytic(InputAnalytics.IInputAnalytic analytic) | |
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 | ||
#elif (ENABLE_CLOUD_SERVICES_ANALYTICS) // Implicitly: !UNITY_EDITOR && UNITY_ANALYTICS | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Follow-up, logged into a console VM and built a basically empty project for target hardware. Interestingly enough I got these results in editor (build profile set to console profile): UNITY_EDITOR:True, UNITY_ANALYTICS:False, ENABLE_CLOUD_SERVICES_ANALYTICS:False And on target device (player): UNITY_EDITOR:False, UNITY_ANALYTICS:False, ENABLE_CLOUD_SERVICES_ANALYTICS:False Additionally, I removed the ENABLE_CLOUD_SERVICES_ANALYTICS check completely from NativeInputRuntime.cs and I could still build for the console without issues, both in editor and player based on how it's currently defined. This confused me since the original fix states this was not possible? I then removed all checks/code but the Analytics.XXX part and that fails to build in editor in this case. Hence, guarding this with ENABLE_CLOUD_SERVICES_ANALYTICS makes sense. I then removed all but the EditorAnalytics part. This compiles/runs fine in editor and is excluded in player since guarded with UNITY_EDITOR. Hence it boils down to ENABLE_CLOUD_SERVICES_ANALYTICS should be used for access to Analytics, i.e. the analytics module. However, whether UNITY_ANALYTICS should be checked or not remains an enigma to me. Probably it should since we had it there previously? |
||
var info = analytic.info; | ||
Analytics.Analytics.RegisterEvent(info.Name, info.MaxEventsPerHour, info.MaxNumberOfElements, InputAnalytics.kVendorKey); | ||
if (analytic.TryGatherData(out var data, out var error)) | ||
Analytics.Analytics.SendEvent(info.Name, data); | ||
else | ||
Debug.Log(error); // Non fatal | ||
#endif //UNITY_EDITOR | ||
#endif //ENABLE_CLOUD_SERVICES_ANALYTICS | ||
} | ||
|
||
#endif // UNITY_ANALYTICS || UNITY_EDITOR | ||
|
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.
Question remains whether UNITY_ANALYTICS should be a precondition 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.
On line #392
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.
Based on git history I would just assume it should, e.g. before I started to edit this it looked like this (dates back to 2018 when it was introduced) 6df6e11: