GitAssetPostprocessor.cs 616 B

123456789101112131415161718192021
  1. // Copyright (c) 2025 TerraByte Inc.
  2. //
  3. // This script hooks into Unity's asset pipeline to automatically
  4. // trigger a refresh of the Better Git window when assets change.
  5. using UnityEditor;
  6. namespace Terra.Arbitrator.GUI
  7. {
  8. public class GitAssetPostprocessor : AssetPostprocessor
  9. {
  10. private static void OnPostprocessAllAssets(string[] _, string[] __, string[] ___, string[] ____)
  11. {
  12. var window = EditorWindow.GetWindow<ArbitratorWindow>(false, null, false);
  13. if (window != null)
  14. {
  15. window.TriggerAutoRefresh();
  16. }
  17. }
  18. }
  19. }