IUIAssetModule.cs 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  1. using XGame.Framework.Asset;
  2. namespace XGame.Framework.UI
  3. {
  4. /// <summary>
  5. /// UI的加载模块
  6. /// 每个UIView都有一个独立的IUIAssetModule
  7. /// </summary>
  8. public interface IUIAssetModule
  9. {
  10. /// <summary>
  11. /// 异步加载接口
  12. /// 使用该接口加载的资源严禁使用Object.Destroy销毁,只能使用Recycle(obj)方法回收
  13. /// </summary>
  14. /// <typeparam name="TResult">返回对象类型</typeparam>
  15. /// <param name="addressableName">可寻址资源名字</param>
  16. /// <returns>返回异步回调</returns>
  17. IAssetLoadAsync<TResult> LoadAsync<TResult>(string addressableName) where TResult : UnityEngine.Object;
  18. /// <summary>
  19. /// 回收资源
  20. /// </summary>
  21. /// <param name="obj"></param>
  22. void Recycle(UnityEngine.Object obj);
  23. /// <summary>
  24. /// 结束所有加载的异步
  25. /// </summary>
  26. void StopAllAsyncs();
  27. ///// <summary>
  28. ///// 释放该UI的所有资源
  29. ///// </summary>
  30. //void UnloadUnusedAssets();
  31. }
  32. }