static void CacheAnalyticsData(BaseBrushUIGroup brush) { m_Data.brush_name = brush.brushName; m_Data.shortcuts = s_UsedBrushShortcut; m_Data.mask_filters = brush.brushMaskFilterStack.filters?. Where(x => x.enabled). Select(x => x.GetType().Name).ToArray(); m_Data.strength = CompareSignificance(brush.brushStrength, m_Data.strength); m_Data.size = CompareSignificance(brush.brushSize, m_Data.size); m_Data.rotation = CompareSignificance(brush.brushRotation, m_Data.rotation); m_Data.spacing = CompareSignificance(brush.brushSpacing, m_Data.spacing); m_Data.scatter = CompareSignificance(brush.brushScatter, m_Data.scatter); m_Data.brush_parameters = s_ModifiedBrushParameters; }
/// <summary> /// Update the analytics data to be sent when a user starts painting with new parameters/settings /// The users time is being tracked while painting /// Once the user changes any brush parameters original data is sent and the new data is cached to be compared later /// </summary> /// <param name="baseBrushSettings">Brush Base class containing common brush parameters</param> /// <param name="brushParamFunc">Function returning brush specific parameters</param> internal static void UpdateAnalytics(BaseBrushUIGroup baseBrushSettings, Func <TerrainToolsAnalytics.IBrushParameter[]> brushParamFunc) { if (!EnableAnalytics()) { return; } s_PaintingDuration += Time.deltaTime; if (!s_ParameterChanged) { return; } SendAnalytics(); CompareBrushSettings(brushParamFunc?.Invoke()); CacheAnalyticsData(baseBrushSettings); }