Files
GameDevTVObstacleDodge/Library/PackageCache/com.unity.collab-proxy@1ec4e416a4af/Editor/SwitchUVCSPlugin.cs

53 lines
1.3 KiB
C#
Raw Normal View History

2026-01-08 16:50:20 +00:00
using Unity.PlasticSCM.Editor.Settings;
using Unity.PlasticSCM.Editor.UI;
namespace Unity.PlasticSCM.Editor
{
internal static class SwitchUVCSPlugin
{
internal static UVCSWindow On(UVCSPlugin uvcsPlugin)
{
uvcsPlugin.Enable();
UVCSWindow window = ShowWindow.UVCS();
UVCSPluginIsEnabledPreference.Enable();
return window;
}
internal static UVCSWindow OnIfNeeded(UVCSPlugin uvcsPlugin)
{
if (!UVCSPluginIsEnabledPreference.IsEnabled())
{
UVCSWindow result = On(uvcsPlugin);
ReloadSettings();
return result;
}
return ShowWindow.UVCS();
}
internal static void Off(UVCSPlugin uvcsPlugin)
{
UVCSPluginIsEnabledPreference.Disable();
CloseWindowIfOpened.UVCS();
uvcsPlugin.Shutdown();
}
static void ReloadSettings()
{
UVCSProjectSettingsProvider activeSettingsProvider =
UVCSPlugin.Instance.ActiveUVCSSettingsProvider;
if (activeSettingsProvider == null)
return;
activeSettingsProvider.ReloadSettings();
activeSettingsProvider.Repaint();
}
}
}