#if ENABLE_CLOUD_SERVICES_ANALYTICS || UNITY_2023_2_OR_NEWER using System; using UnityEngine; using UnityEngine.Analytics; namespace UnityEditor.XR.Interaction.Toolkit.Analytics { /// /// The analytics event for play mode. /// #if UNITY_2023_2_OR_NEWER [AnalyticInfo(k_EventName, XRIAnalytics.VendorKey, k_EventVersion, k_MaxEventsPerHour, k_MaxItems)] #endif class XRIPlayModeEvent : XRIBaseAnalyticsEvent { const string k_EventName = "xrinteractiontoolkit_playmode"; const int k_EventVersion = 1; const int k_MaxEventsPerHour = XRIAnalytics.DefaultMaxEventsPerHour; const int k_MaxItems = XRIAnalytics.DefaultMaxItems; /// /// The analytics payload for play mode. /// [Serializable] public struct Payload #if UNITY_2023_2_OR_NEWER : IAnalytic.IData #endif { // Do not rename any field, the field names are used to identify the table/event column of this event payload. /// /// The currently active build target. /// UnityEditor.BuildTarget enum as a string. /// [SerializeField] public string activeBuildTarget; /// /// The currently active build target group. /// [SerializeField] public string activeBuildTargetGroup; /// /// Whether project settings has the automatic startup of XR at runtime enabled. /// This is the checkbox for Initialize XR on Startup in Edit > Project Settings > XR Plug-in Management. /// [SerializeField] public bool initManagerOnStart; /// /// The currently active XR Plug-in Management plug-in provider instance (UnityEngine.XR.Management.XRLoader). /// This may be empty if no loader is active or no headset is connected to the computer. /// [SerializeField] public string activeLoader; /// /// The list of enabled XR Plug-in Management plug-in providers (UnityEngine.XR.Management.XRLoader). /// This is the list of checkboxes in Edit > Project Settings > XR Plug-in Management. /// /// /// Note that Editor Play mode uses Desktop Platform Settings regardless of Active Build Target. /// [SerializeField] public string[] activeLoaders; /// /// The list of relevant XR packages that are installed in the project. /// [SerializeField] public PackageVersionData[] packages; /// /// General project settings that does not relate to XR specifically. /// [SerializeField] public GeneralProjectSettingsData generalProjectSettings; /// /// XRI package project settings data. /// [SerializeField] public XRIProjectSettingsData xriProjectSettings; /// /// Oculus package project settings data. Only valid if Oculus is enabled in the XR Plug-in Management project settings. /// [SerializeField] public OculusProjectSettingsData oculusProjectSettings; /// /// OpenXR package project settings data. Only valid if OpenXR is enabled in the XR Plug-in Management project settings. /// [SerializeField] public OpenXRProjectSettingsData openXRProjectSettings; /// /// The effective current setting related to scene and domain reload, which can greatly affect the duration spent to enter play mode. /// This corresponds with Enter Play Mode Settings inside Edit > Project Settings > Editor. /// 0 = Reload Domain and Scene /// 1 = Reload Scene only /// 2 = Reload Domain only /// 3 = Do not reload Domain or Scene /// [SerializeField] public EnterPlayModeOptions enterPlayModeSettings; /// /// Peak number of enabled input modality managers during a play mode session. /// [SerializeField] public int modalityManagersPeakCount; /// /// Total count of different input modality managers that were enabled during a play mode session. /// [SerializeField] public int modalityManagersObjectCount; /// /// Peak number of enabled interaction managers during a play mode session. /// [SerializeField] public int interactionManagersPeakCount; /// /// Total count of different interaction managers that were enabled during a play mode session. /// [SerializeField] public int interactionManagersObjectCount; /// /// Peak number of registered interactors across all interaction managers during a play mode session. /// [SerializeField] public int interactorsPeakRegisteredCount; /// /// Total count of different interactors that were registered during a play mode session. /// [SerializeField] public int interactorsObjectRegisteredCount; /// /// Peak number of registered interactables across all interaction managers during a play mode session. /// [SerializeField] public int interactablesPeakRegisteredCount; /// /// Total count of different interactables that were registered during a play mode session. /// [SerializeField] public int interactablesObjectRegisteredCount; /// /// The timestamp when the Unity Editor has entered play mode. /// This is DateTime.Now.Ticks at PlayModeStateChange.EnteredPlayMode. /// [SerializeField] public long playModeStartTimeTicks; /// /// The timestamp when the Unity Editor is exiting play mode. /// This is DateTime.Now.Ticks at PlayModeStateChange.ExitingPlayMode /// [SerializeField] public long playModeEndTimeTicks; /// /// Duration in seconds it took to enter play mode from clicking the play button. /// This is Time.realtimeSinceStartupAsDouble at PlayModeStateChange.EnteredPlayMode. /// [SerializeField] public float enteredPlayModeDurationSeconds; /// /// Duration in seconds of the play mode session. /// This is Time.realtimeSinceStartupAsDouble between PlayModeStateChange.EnteredPlayMode and PlayModeStateChange.ExitingPlayMode. /// [SerializeField] public float playModeDurationSeconds; /// /// Duration in seconds of at least one enabled input modality manager during a play mode session. /// [SerializeField] public float modalityManagerDurationSeconds; /// /// Information about the modality of the left hand/controller during a play mode session. /// [SerializeField] public ModalityRuntimeData leftModalityInfo; /// /// Information about the modality of the right hand/controller during a play mode session. /// [SerializeField] public ModalityRuntimeData rightModalityInfo; /// /// Duration in seconds of at least one enabled interaction manager during a play mode session. /// [SerializeField] public float interactionManagerDurationSeconds; /// /// Duration in seconds of the classic simulator component singleton being active during a play mode session. /// [SerializeField] public float deviceSimulatorDurationSeconds; /// /// The number of different classic simulator components that were active during a play mode session. /// [SerializeField] public int deviceSimulatorSessionCount; /// /// Duration in seconds of the newer interaction simulator component singleton being active during a play mode session. /// [SerializeField] public float interactionSimulatorDurationSeconds; /// /// The number of different newer interaction simulator components that were active during a play mode session. /// [SerializeField] public int interactionSimulatorSessionCount; #if UNITY_2023_2_OR_NEWER /// /// The package name of the XR Interaction Toolkit, i.e. com.unity.xr.interaction.toolkit. /// [SerializeField] public string package; /// /// The version of the XR Interaction Toolkit package installed. /// [SerializeField] public string package_ver; #endif } #if !UNITY_2023_2_OR_NEWER /// public XRIPlayModeEvent() : base(k_EventName, k_EventVersion, k_MaxEventsPerHour, k_MaxItems) { } #endif } } #endif