BaseLoader.cs 780 B

1234567891011121314151617181920212223242526272829303132
  1. namespace XGame.Framework.Asset
  2. {
  3. internal abstract class BaseLoader : System.IDisposable
  4. {
  5. private static AssetAsyncPool asyncPool;
  6. protected AssetAsyncPool AsyncPool
  7. {
  8. get
  9. {
  10. if (asyncPool == null)
  11. {
  12. asyncPool = new AssetAsyncPool()
  13. {
  14. AgentLimit = 10
  15. };
  16. }
  17. return asyncPool;
  18. }
  19. }
  20. void System.IDisposable.Dispose()
  21. {
  22. OnDispose();
  23. asyncPool?.Dispose();
  24. //assetCtrl?.Dispose();
  25. asyncPool = null;
  26. //assetCtrl = null;
  27. }
  28. protected abstract void OnDispose();
  29. }
  30. }