No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

RefreshAsset.cs 958B

123456789101112131415161718192021222324252627282930313233343536
  1. using Unity.PlasticSCM.Editor.AssetUtils.Processor;
  2. namespace Unity.PlasticSCM.Editor.AssetUtils
  3. {
  4. internal static class RefreshAsset
  5. {
  6. internal static void BeforeLongAssetOperation()
  7. {
  8. UnityEditor.AssetDatabase.DisallowAutoRefresh();
  9. }
  10. internal static void AfterLongAssetOperation()
  11. {
  12. UnityEditor.AssetDatabase.AllowAutoRefresh();
  13. UnityAssetDatabase();
  14. }
  15. internal static void UnityAssetDatabase()
  16. {
  17. UnityEditor.AssetDatabase.Refresh(
  18. UnityEditor.ImportAssetOptions.Default);
  19. UnityEditor.VersionControl.Provider.ClearCache();
  20. AssetPostprocessor.SetIsRepaintInspectorNeededAfterAssetDatabaseRefresh();
  21. }
  22. internal static void VersionControlCache()
  23. {
  24. UnityEditor.VersionControl.Provider.ClearCache();
  25. RepaintInspector.All();
  26. }
  27. }
  28. }