SysRepaintWindow.cs 896 B

123456789101112131415161718192021222324252627282930
  1. using Leopotam.Ecs;
  2. using UnityEditor;
  3. using UnityEditorInternal;
  4. using UnityEngine;
  5. namespace Asset_Cleaner {
  6. class RequestRepaintEvt { }
  7. class SysRepaintWindow : IEcsRunSystem, IEcsInitSystem {
  8. EcsFilter<RequestRepaintEvt> Repaint = null;
  9. public void Init() {
  10. var wd = Globals<WindowData>.Value;
  11. wd.SceneFoldout = new GUIContent(AssetPreview.GetMiniTypeThumbnail(typeof(SceneAsset)));
  12. wd.ExpandScenes = true;
  13. wd.ExpandFiles = true;
  14. wd.ScrollPos = Vector2.zero;
  15. wd.Window.titleContent = new GUIContent("Asset Cleaner v1.0");
  16. }
  17. public void Run() {
  18. var wd = Globals<WindowData>.Value;
  19. if (Repaint.IsEmpty()) return;
  20. wd.Window.Repaint();
  21. InternalEditorUtility.RepaintAllViews();
  22. Repaint.AllDestroy();
  23. }
  24. }
  25. }