Skip to content

Commit 02b882b

Browse files
svc-reach-platform-supportEvergreen
authored andcommitted
[Port] [6000.3] [UUM-115691] - Automatically Springs back to Local on Disconnect
1 parent c0f0605 commit 02b882b

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

Packages/com.unity.render-pipelines.core/Editor/RenderGraph/RenderGraphViewer.cs

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -901,6 +901,11 @@ void OnAutoPlayStatusChanged(ChangeEvent<bool> evt)
901901
autoPlayToggle.text = evt.newValue ? L10n.Tr("Auto Update") : L10n.Tr("Pause");
902902
m_Paused = evt.newValue;
903903

904+
if (!m_Paused && !m_IsDeviceConnected && m_ConnectedDeviceName != k_EditorName)
905+
{
906+
ConnectDebugSession<RenderGraphEditorLocalDebugSession>();
907+
}
908+
904909
UpdateStatusLabel();
905910

906911
// Force update when unpausing
@@ -2100,7 +2105,7 @@ void CreateGUI()
21002105
else
21012106
{
21022107
m_ConnectedDeviceName = k_EditorName;
2103-
m_IsDeviceConnected = false;
2108+
m_IsDeviceConnected = true;
21042109
}
21052110

21062111
connectionState.Dispose(); // Dispose it immediately after use
@@ -2157,15 +2162,22 @@ void OnPlayerDisconnected(int playerID)
21572162
}
21582163
}
21592164

2160-
ConnectDebugSession<RenderGraphEditorLocalDebugSession>();
2165+
if (!m_Paused)
2166+
{
2167+
ConnectDebugSession<RenderGraphEditorLocalDebugSession>();
2168+
}
2169+
else
2170+
{
2171+
UpdateStatusLabel();
2172+
}
21612173
}
21622174

21632175
internal void ConnectDebugSession<TSession>()
21642176
where TSession : RenderGraphDebugSession, new()
21652177
{
21662178
if (typeof(TSession) == typeof(RenderGraphEditorLocalDebugSession))
21672179
{
2168-
if (!m_IsDeviceConnected)
2180+
if (m_ConnectedDeviceName == "Unknown" || m_ConnectedDeviceName == k_EditorName)
21692181
{
21702182
m_ConnectedDeviceName = k_EditorName;
21712183
m_IsDeviceConnected = true;

0 commit comments

Comments
 (0)