using System.Collections.Generic; using UnityEditor.Experimental; using UnityEditor.Experimental.GraphView; using UnityEngine; using UnityEngine.Profiling; using UnityEngine.VFX; using UnityEngine.UIElements; using PositionType = UnityEngine.UIElements.Position; namespace UnityEditor.VFX.UI { class VFXProfilingBoard : GraphElement, IControlledElement, IVFXMovable, IVFXResizable { VFXViewController m_Controller; Controller IControlledElement.controller { get { return m_Controller; } } public VFXViewController controller { get { return m_Controller; } set { if (m_Controller != value) { if (m_Controller != null) { m_Controller.UnregisterHandler(this); } Clear(); m_Controller = value; if (m_Controller != null) { m_Controller.RegisterHandler(this); } } } } public bool hasExpandedPanel { get { foreach (var panel in m_AnchoredProfilerPanels) { if (!panel.isCollapsed) return true; } return false; } } VFXView m_View; IVisualElementScheduledItem m_UpdateItem; IVisualElementScheduledItem m_TimingCollectionUpdateItem; VisualEffect m_AttachedComponent; private bool m_Enabled; private bool m_SupportsGPURecorder; private readonly int kDisplayUpdatePeriodMs = 300; private readonly int kCollectUpdatePeriodMs = 10; public VFXProfilingBoard(VFXView view) { m_View = view; var tpl = VFXView.LoadUXML("VFXProfilingBoard"); tpl.CloneTree(contentContainer); contentContainer.AddStyleSheetPath("VFXProfilingBoard"); m_RootElement = this.Query("component-container"); m_SubtitleIcon = this.Query("subTitle-icon"); m_Subtitle = this.Query