This commit is contained in:
2026-11-24 15:51:02 +01:00
parent cca4d73e41
commit f4aa17114a
22092 changed files with 5042406 additions and 0 deletions
@@ -0,0 +1,33 @@
using Unity.PlasticSCM.Editor.UnityInternals.UnityEditor;
using UnityObject = UnityEngine.Object;
namespace Unity.PlasticSCM.Editor.UI
{
internal static class EditorWindowHost
{
internal static bool IsDetached(UnityEditor.EditorWindow window)
{
if (window == null)
return false;
if (UnityEditorExtensions.m_ParentInternal == null)
return false;
return window.m_Parent() == null;
}
internal static void DestroyUvcWindowIfDetached()
{
if (!UnityEditor.EditorWindow.HasOpenInstances<UVCSWindow>())
return;
UVCSWindow window = UnityEditor.EditorWindow.GetWindow<UVCSWindow>(null, false);
if (!IsDetached(window))
return;
UnityObject.DestroyImmediate(window);
}
}
}