ArtInstance.cs 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using UnityEngine;
  5. namespace ShadowStudio.Model
  6. {
  7. /// <summary>
  8. /// 美术资源实例化
  9. /// </summary>
  10. public interface ArtInstance
  11. {
  12. /// <summary>
  13. /// 初始化资源
  14. /// </summary>
  15. /// <param name="info"></param>
  16. void SetData(ArtInfo info, string containerName = "");
  17. /// <summary>
  18. /// 获取缩略图
  19. /// </summary>
  20. /// <returns></returns>
  21. Texture GetIcon();
  22. void GetIcon(Action<Texture> loadTex);
  23. /// <summary>
  24. /// 同步加载资源
  25. /// </summary>
  26. /// <returns></returns>
  27. UnityEngine.Object LoadArt();
  28. /// <summary>
  29. /// 异步加载资源
  30. /// </summary>
  31. /// <param name="path"></param>
  32. /// <param name="process"></param>
  33. /// <param name="loaded"></param>
  34. void LoadArtAsyn(string path, Action<float> process, Action<UnityEngine.Object> loaded);
  35. /// <summary>
  36. /// 实例化对象
  37. /// </summary>
  38. UnityEngine.Object InstanceArt();
  39. ArtComponent InstanceComponent();
  40. /// <summary>
  41. /// 是否已下载
  42. /// </summary>
  43. /// <returns></returns>
  44. bool IsDownLoad();
  45. void DownLoad(Action<float, float> downProcess, Action<string, byte[]> downComplete);
  46. float DownProcess { get; set; }
  47. }
  48. }