LocalAssetLoadTask.cs 1000 B

1234567891011121314151617181920212223242526272829303132
  1. using System.Collections.Generic;
  2. using Fort23.Core;
  3. namespace Core.AssetLoadTool.Asset
  4. {
  5. public class LocalAssetLoadTask : AssetLoadTaskBasic
  6. {
  7. private List<TimerEntity> timers = new List<TimerEntity>();
  8. protected override void StartLoadAsset<T>()
  9. {
  10. #if UNITY_EDITOR
  11. TimerEntity timer = TimerComponent.Instance.AddTimer(100, delegate()
  12. {
  13. T objAsset = UnityEditor.AssetDatabase.LoadAssetAtPath<T>(_assetInfo.localPath);
  14. LoadFinish<T>(objAsset);
  15. });
  16. timers.Add(timer);
  17. #endif
  18. }
  19. protected override void ProDispose()
  20. {
  21. for (int i = 0; i < timers.Count; i++)
  22. {
  23. TimerComponent.Instance.Remove(timers[i]);
  24. }
  25. timers.Clear();
  26. }
  27. }
  28. }