IAssetAsync.cs 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. using XGame.Framework.Asyncs;
  2. namespace XGame.Framework.Asset
  3. {
  4. /// <summary>
  5. /// 资源加载的Async
  6. /// </summary>
  7. public interface IAssetAsync : IAsync
  8. {
  9. ///// <summary>
  10. ///// 资源路径
  11. ///// </summary>
  12. //string Path { get; }
  13. /// <summary>
  14. /// 资源名字
  15. /// </summary>
  16. string AddressableName { get; }
  17. /// <summary>
  18. /// 开始
  19. /// </summary>
  20. void Start();
  21. /// <summary>
  22. /// 返回结果
  23. /// </summary>
  24. /// <returns></returns>
  25. object GetResult();
  26. }
  27. public interface IAssetCacheHandle
  28. {
  29. /// <summary>
  30. /// 从AssetManager获取Asset实例
  31. /// </summary>
  32. /// <param name="addressableName"></param>
  33. /// <returns></returns>
  34. object GetAssetFromCache(string addressableName);
  35. /// <summary>
  36. /// 释放缓存
  37. /// </summary>
  38. /// <param name="async"></param>
  39. void ReleaseAsync(IAsync async);
  40. /// <summary>
  41. /// 设置资源的预加载标记
  42. /// </summary>
  43. /// <param name="addressableName"></param>
  44. /// <param name="isPreload"></param>
  45. void SetPreloadTag(string addressableName, bool isPreload);
  46. }
  47. }