wuxianshengcong/Library/PackageCache/com.unity.collab-proxy@2.5.2/Editor/PlasticSCM/UI/ShowWindow.cs
2025-01-02 14:50:41 +08:00

40 lines
1.1 KiB
C#

using System;
using UnityEditor;
namespace Unity.PlasticSCM.Editor.UI
{
internal static class ShowWindow
{
internal static PlasticWindow Plastic()
{
return ShowPlasticWindow(false);
}
internal static PlasticWindow PlasticDisablingCollab()
{
return ShowPlasticWindow(true);
}
static PlasticWindow ShowPlasticWindow(bool disableCollabWhenLoaded)
{
PlasticWindow window = EditorWindow.GetWindow<PlasticWindow>(
UnityConstants.PLASTIC_WINDOW_TITLE,
true,
mConsoleWindowType,
mProjectBrowserType);
if (disableCollabWhenLoaded)
window.DisableCollabIfEnabledWhenLoaded();
window.UpdateWindowIcon(PlasticPlugin.GetNotificationStatus());
return window;
}
static Type mConsoleWindowType = typeof(EditorWindow).
Assembly.GetType("UnityEditor.ConsoleWindow");
static Type mProjectBrowserType = typeof(EditorWindow).
Assembly.GetType("UnityEditor.ProjectBrowser");
}
}