using System; using System.Runtime.InteropServices; using System.Text; using Unity.Profiling.Editor; using UnityEditor; using UnityEngine.UIElements; using UnityEngine.AdaptivePerformance; using System.Reflection; using UnityEngine; using UnityEditor.AdaptivePerformance.UI.Editor; internal class AdaptivePerformanceDetailsViewController : ProfilerModuleViewController { const string k_UxmlResourceName = "Packages/com.unity.adaptiveperformance/Editor/Profiler/AdaptivePerformanceDetailsView.uxml"; const string k_UxmlResourceNameScaler = "Packages/com.unity.adaptiveperformance/Editor/Profiler/AdaptivePerformanceScalerElement.uxml"; VisualElement m_view; Label m_DetailsViewLabel; VisualElement m_Scalers; UsageDial m_UsageDial; Label m_BottleneckLabel; VisualElement m_BottleneckIcon; Label m_UsageDialLabel; StyleColor m_appliedScalerColor = new StyleColor(new Color(0.09f, 0.69f, 0.3f, 1f)); StyleColor m_unappliedScalerColor = new StyleColor(new Color(0.09f, 0.3f, 0.69f, 1f)); StyleColor m_inactiveColor = new StyleColor(new Color(0.29f, 0.69f, 0.3f, 0.3f)); Length m_scalerOffset = new Length(-200, LengthUnit.Pixel); Length m_midDistance = new Length(100, LengthUnit.Pixel); StyleRotate m_scalerRotate = new StyleRotate(new Rotate(180)); static readonly StyleColor k_Green = new StyleColor(new Color32(136, 176, 49, byte.MaxValue)); static readonly StyleColor k_Yellow = new StyleColor(new Color32(221, 124, 69, byte.MaxValue)); static readonly StyleColor k_Red = new StyleColor(new Color32(219, 89, 81, byte.MaxValue)); public AdaptivePerformanceDetailsViewController(ProfilerWindow profilerWindow) : base(profilerWindow) {} protected override VisualElement CreateView() { var apDetailsView = AssetDatabase.LoadAssetAtPath(k_UxmlResourceName); m_view = apDetailsView.Instantiate(); m_DetailsViewLabel = m_view.Q