Firstborn/Library/PackageCache/com.unity.collab-proxy@1.17.7/Editor/PlasticSCM/AssetsUtils/RefreshAsset.cs
Schaken-Mods b486678290 Library -Artifacts
Library -Artifacts
2023-03-28 12:24:16 -05:00

36 lines
958 B
C#

using Unity.PlasticSCM.Editor.AssetUtils.Processor;
namespace Unity.PlasticSCM.Editor.AssetUtils
{
internal static class RefreshAsset
{
internal static void BeforeLongAssetOperation()
{
UnityEditor.AssetDatabase.DisallowAutoRefresh();
}
internal static void AfterLongAssetOperation()
{
UnityEditor.AssetDatabase.AllowAutoRefresh();
UnityAssetDatabase();
}
internal static void UnityAssetDatabase()
{
UnityEditor.AssetDatabase.Refresh(
UnityEditor.ImportAssetOptions.Default);
UnityEditor.VersionControl.Provider.ClearCache();
AssetPostprocessor.SetIsRepaintInspectorNeededAfterAssetDatabaseRefresh();
}
internal static void VersionControlCache()
{
UnityEditor.VersionControl.Provider.ClearCache();
RepaintInspector.All();
}
}
}