using System; using System.Collections.Generic; namespace UnityEngine.Rendering { /// /// Display stats panel /// /// Type of ProfileId the pipeline uses public class DebugDisplaySettingsStats : IDebugDisplaySettingsData where TProfileId : Enum { /// Current display stats public DebugDisplayStats debugDisplayStats { get; } /// /// Display stats panel constructor with settings /// /// The debug display stats object that is used for configuring settings in the stats panel. public DebugDisplaySettingsStats(DebugDisplayStats debugDisplayStats) { this.debugDisplayStats = debugDisplayStats; } [DisplayInfo(name = "Display Stats", order = int.MinValue)] private class StatsPanel : DebugDisplaySettingsPanel { readonly DebugDisplaySettingsStats m_Data; public override DebugUI.Flags Flags => DebugUI.Flags.RuntimeOnly; public StatsPanel(DebugDisplaySettingsStats displaySettingsStats) { m_Data = displaySettingsStats; m_Data.debugDisplayStats.EnableProfilingRecorders(); var list = new List(); m_Data.debugDisplayStats.RegisterDebugUI(list); foreach (var w in list) AddWidget(w); } public override void Dispose() { m_Data.debugDisplayStats.DisableProfilingRecorders(); base.Dispose(); } } /// public bool AreAnySettingsActive => false; /// public IDebugDisplaySettingsPanelDisposable CreatePanel() { return new StatsPanel(this); } } }