AssetLoadFromCacheAsync.cs 831 B

12345678910111213141516171819202122232425262728293031323334
  1. 
  2. using XGame.Framework.Asyncs;
  3. namespace XGame.Framework.Asset
  4. {
  5. /// <summary>
  6. /// 从AssetBundleLoader缓存重新加载回来的Asset
  7. /// 该异步为伪异步,不需要进AsyncPool,而是直接使用Start()结束异步操作
  8. /// </summary>
  9. internal class AssetLoadFromCacheAsync : Async, IAssetAsync
  10. {
  11. public UnityEngine.Object Source { internal set; get; }
  12. //public string Path { internal set; get; }
  13. public string AddressableName { get; internal set; }
  14. public void Start()
  15. {
  16. Progress = 1f;
  17. Completed();
  18. }
  19. public object GetResult()
  20. {
  21. object result = Source;
  22. Clear();
  23. return result;
  24. }
  25. void Clear()
  26. {
  27. Source = null;
  28. }
  29. }
  30. }