Skip to content

Commit 155676a

Browse files
ludovic-theobaldEvergreen
authored andcommitted
[VFX] Profiling window / panels fixes
1 parent 7423568 commit 155676a

2 files changed

Lines changed: 6 additions & 16 deletions

File tree

Packages/com.unity.visualeffectgraph/Editor/GraphView/Profiling/VFXProfilingBoard.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ private void CreateOrResumeUpdateItems()
394394

395395
void Update()
396396
{
397-
if (m_AttachedComponent == null)
397+
if (m_AttachedComponent == null || m_AttachedComponent.visualEffectAsset == null)
398398
{
399399
Detach();
400400
return;

Packages/com.unity.visualeffectgraph/Editor/GraphView/Profiling/VFXSystemProfilerUI.cs

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,11 @@ public VFXSystemProfilerUI(VFXContextUI initContextUI, List<VFXContextProfilerUI
1313

1414
controller = initContextUI.controller;
1515
controller.RegisterHandler(this);
16-
ScheduleRepositionInitializePanel();
16+
RegisterCallback<GeometryChangedEvent, VFXContextProfilerUI>((e, contextPanel) =>
17+
{
18+
contextPanel.SetVerticalOffset(e.newRect.height);
19+
contextPanel.RepositionPanel();
20+
}, m_SystemContexts[0]);
1721

1822
VFXSystemNames systemNames = controller.viewController.graph.systemNames;
1923
string systemName = systemNames.GetUniqueSystemName(controller.model.GetData());
@@ -70,20 +74,6 @@ public string GetSystemName()
7074
return m_SystemName;
7175
}
7276

73-
void ScheduleRepositionInitializePanel()
74-
{
75-
schedule.Execute(() =>
76-
{
77-
m_SystemContexts[0].SetVerticalOffset(resolvedStyle.height);
78-
m_SystemContexts[0].RepositionPanel();
79-
});
80-
}
81-
protected override void OnCollapseChanged(ChangeEvent<bool> evt)
82-
{
83-
base.OnCollapseChanged(evt);
84-
ScheduleRepositionInitializePanel();
85-
}
86-
8777
void AddStatusSection()
8878
{
8979
VisualElement statusContainer = new VisualElement

0 commit comments

Comments
 (0)