using UnityEditor; using Unity.PlasticSCM.Editor.CloudDrive; using Unity.PlasticSCM.Editor.Diff; using Unity.PlasticSCM.Editor.Views.BranchExplorer; using Unity.PlasticSCM.Editor.Views.BranchExplorer.Options; namespace Unity.PlasticSCM.Editor.UI { internal static class CloseWindowIfOpened { internal static void UVCS() { if (!EditorWindow.HasOpenInstances()) return; UVCSWindow window = EditorWindow.GetWindow(null, false); if (EditorWindowHost.IsDetached(window)) { UnityEngine.Object.DestroyImmediate(window); return; } window.Close(); } internal static void BranchExplorer() { if (!EditorWindow.HasOpenInstances()) return; BranchExplorerWindow window = EditorWindow.GetWindow(null, false); window.Close(); } internal static void Diff() { if (!EditorWindow.HasOpenInstances()) return; UnityDiffWindow window = EditorWindow.GetWindow(null, false); window.Close(); } internal static void BranchExplorerOptions() { if (!EditorWindow.HasOpenInstances()) return; BranchExplorerOptionsWindow window = EditorWindow. GetWindow(null, false); window.Close(); } internal static void CloudDrive() { if (!EditorWindow.HasOpenInstances()) return; CloudDriveWindow window = EditorWindow.GetWindow(null, false); window.Close(); } } }