Version: 2020.3

AnalyticsSettings.OnRequireInBuildHandler

切换到手册

描述

只要平台版本启动都进行分发。使用此事件可在平台版本中启用 Analytics。

using UnityEditor;

[InitializeOnLoad] internal class SomeNewServiceRequiresAnalyticsDeviceStats { static SomeNewServiceRequiresAnalyticsDeviceStats() { UnityEditor.Analytics.AnalyticsSettings.OnRequireInBuildHandler += () => { return true; }; } }