Esempio n. 1
0
        private static void DrawSpikeHighlightControls()
        {
            inspectorSpikeHighlightEnabled = EditorGUILayout.Toggle(Contents.enableInspectorSpikeHighlighContent, inspectorSpikeHighlightEnabled);
#if PERFORMANCE_TRACKING_DEBUG
            spikeHighlightStrategy = (SpikeHighlightStrategy)EditorGUILayout.EnumPopup(new GUIContent("Spike triggers on"), spikeHighlightStrategy);
            spikeDuration          = DrawSlider("Spike Duration (seconds)", spikeDuration, 0, 10);
#endif
            spikeWarningThreshold  = DrawSlider($"<color={PtStyles.warningHexCode}>Warning threshold (milliseconds)</color>", spikeWarningThreshold * 1000, 1, 50) / 1000;
            spikeCriticalThreshold = DrawSlider($"<color={PtStyles.criticalHexCode}>Critical threshold (milliseconds)</color>", spikeCriticalThreshold * 1000, spikeWarningThreshold * 1000, 100) / 1000;
        }
 public PerformanceTrackingEvent()
 {
     monitoringUpdateSpeed  = PerformanceTrackerSettings.monitoringUpdateSpeed;
     monitoringNeeded       = PerformanceTrackerSettings.monitoringNeeded;
     notifications          = PerformanceTrackerSettings.notifications.items;
     notificationEnabled    = PerformanceTrackerSettings.notificationEnabled;
     spikeHighlightStrategy = PerformanceTrackerSettings.spikeHighlightStrategy;
     spikeHighlightEnabled  = PerformanceTrackerSettings.spikeHighlightEnabled;
     spikeWarningThreshold  = PerformanceTrackerSettings.spikeWarningThreshold;
     spikeCriticalThreshold = PerformanceTrackerSettings.spikeCriticalThreshold;
     spikeDuration          = PerformanceTrackerSettings.spikeDuration;
 }
Esempio n. 3
0
        private static void ResetSettings()
        {
            spikeHighlightEnabled          = Defaults.spikeHighlightEnabled;
            notificationEnabled            = Defaults.notificationEnabled;
            inspectorSpikeHighlightEnabled = Defaults.inspectorSpikeHighlightEnabled;
            monitoringUpdateSpeed          = Defaults.monitoringUpdateSpeed;
            notifications          = Defaults.GetDefaultNotifications();
            spikeWarningThreshold  = Defaults.spikeWarningThreshold;
            spikeCriticalThreshold = Defaults.spikeCriticalThreshold;

            spikeHighlightStrategy = Defaults.spikeHighlightStrategy;
            spikeDuration          = Defaults.spikeDuration;
        }
Esempio n. 4
0
        private static void Load()
        {
            spikeHighlightEnabled          = EditorPrefs.GetBool(GetKeyName(nameof(spikeHighlightEnabled)), Defaults.spikeHighlightEnabled);
            notificationEnabled            = EditorPrefs.GetBool(GetKeyName(nameof(notificationEnabled)), Defaults.notificationEnabled);
            inspectorSpikeHighlightEnabled = EditorPrefs.GetBool(GetKeyName(nameof(inspectorSpikeHighlightEnabled)), Defaults.inspectorSpikeHighlightEnabled);
            monitoringUpdateSpeed          = EditorPrefs.GetFloat(GetKeyName(nameof(monitoringUpdateSpeed)), Defaults.monitoringUpdateSpeed);
            notifications          = LoadPerformanceNotificationCollection();
            spikeWarningThreshold  = EditorPrefs.GetFloat(GetKeyName(nameof(spikeWarningThreshold)), Defaults.spikeWarningThreshold);
            spikeCriticalThreshold = EditorPrefs.GetFloat(GetKeyName(nameof(spikeCriticalThreshold)), Defaults.spikeCriticalThreshold);

            spikeHighlightStrategy = Defaults.spikeHighlightStrategy;
            spikeDuration          = Defaults.spikeDuration;
#if PERFORMANCE_TRACKING_DEBUG
            spikeDuration = EditorPrefs.GetFloat(GetKeyName(nameof(spikeDuration)), Defaults.spikeDuration);
            Enum.TryParse(EditorPrefs.GetString(GetKeyName(nameof(spikeHighlightStrategy)), Defaults.spikeHighlightStrategy.ToString()), out spikeHighlightStrategy);
#endif

            BuildCaches();
        }