ResourcesLoaderComponent.cs 587 B

1234567891011121314151617
  1. using System.Collections.Generic;
  2. using UnityEngine.SceneManagement;
  3. using YooAsset;
  4. namespace ET.Client
  5. {
  6. /// <summary>
  7. /// 用来管理资源,生命周期跟随Parent,比如CurrentScene用到的资源应该用CurrentScene的ResourcesLoaderComponent来加载
  8. /// 这样CurrentScene释放后,它用到的所有资源都释放了
  9. /// </summary>
  10. [ComponentOf]
  11. public class ResourcesLoaderComponent : Entity, IAwake, IAwake<string>, IDestroy
  12. {
  13. public ResourcePackage package;
  14. public Dictionary<string, HandleBase> handlers = new();
  15. }
  16. }