Adaug proiectul Unity

This commit is contained in:
2026-11-01 23:39:55 +02:00
parent cb14d9d37d
commit 863eac8f2c
23463 changed files with 5412601 additions and 0 deletions
@@ -0,0 +1,59 @@
using Unity.PlasticSCM.Editor.Inspector.Properties;
using Unity.PlasticSCM.Editor.Settings;
using Unity.PlasticSCM.Editor.UI;
using UnityEditor;
namespace Unity.PlasticSCM.Editor
{
internal static class SwitchUVCSPlugin
{
internal static UVCSWindow On(UVCSPlugin uvcsPlugin)
{
UVCSPluginIsEnabledPreference.Enable();
uvcsPlugin.Enable();
UVCSWindow window = ShowWindow.UVCS();
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();
CloseWindowIfOpened.BranchExplorer();
CloseWindowIfOpened.Diff();
CleanSelectionIfNeeded();
uvcsPlugin.Shutdown();
}
static void ReloadSettings()
{
UVCSProjectSettingsProvider.GetIfActive()?.ReloadSettings();
}
static void CleanSelectionIfNeeded()
{
if (!(Selection.activeObject is SelectedRepObjectInfoData))
return;
Selection.activeObject = null;
}
}
}