每当平台构建开始时调度。使用此事件在平台构建中启用分析。
using UnityEditor;
[InitializeOnLoad] internal class SomeNewServiceRequiresAnalyticsDeviceStats { static SomeNewServiceRequiresAnalyticsDeviceStats() { UnityEditor.Analytics.AnalyticsSettings.OnRequireInBuildHandler += () => { return true; }; } }