ArtInfo.cs 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. 
  2. namespace ShadowStudio.Model
  3. {
  4. /// <summary>
  5. /// 资源类型,后续扩展
  6. /// </summary>
  7. [System.Flags]
  8. public enum ArtType
  9. {
  10. /// <summary>
  11. /// 模型
  12. /// </summary>
  13. Model = 1,
  14. /// <summary>
  15. /// 图片
  16. /// </summary>
  17. Image = 2,
  18. /// <summary>
  19. /// 音频
  20. /// </summary>
  21. Audio = 4,
  22. /// <summary>
  23. /// 电影
  24. /// </summary>
  25. Movies = 8,
  26. /// <summary>
  27. /// 游戏对象,预制体,可直接实例化展示,可能是模型,粒子动效,特殊组件
  28. /// 有可能是文本,线,2D编辑框等等
  29. /// </summary>
  30. Prefab = 16,
  31. /// <summary>
  32. /// 2D的模型
  33. /// </summary>
  34. Model2D = 32,
  35. /// <summary>
  36. /// 属于世界UI
  37. /// 图片,视频,文本等都属于World
  38. /// </summary>
  39. WorldDlg = 64,
  40. /// <summary>
  41. /// 工程
  42. /// </summary>
  43. Project = 128
  44. }
  45. /// <summary>
  46. /// 实例化方式
  47. /// </summary>
  48. public enum InstaceType
  49. {
  50. /// <summary>
  51. /// 外部url下载
  52. /// </summary>
  53. ExtralURLDownload = 0,
  54. /// <summary>
  55. /// Unity的基本组件,Cube等
  56. /// </summary>
  57. UnityBase = 1,
  58. /// <summary>
  59. /// 存放于Resource路径下的资源
  60. /// </summary>
  61. ResourceLoad = 2,
  62. /// <summary>
  63. /// 存在本地的资源,例如系统相册
  64. /// </summary>
  65. LocalPath = 3,
  66. /// <summary>
  67. /// AssetBundle资源,依赖加载
  68. /// </summary>
  69. AssetBundle = 4,
  70. /// <summary>
  71. /// 引用类资源,引用类资源如何加上?
  72. /// </summary>
  73. References = 5
  74. }
  75. /// <summary>
  76. /// 资源的结构体
  77. /// </summary>
  78. public class ArtInfo
  79. {
  80. /// <summary>
  81. /// caoting 2021/6/9 新协议创建物品需要的参数,请参考创建物品aid
  82. /// </summary>
  83. private int id;
  84. /// <summary>
  85. /// 资源id
  86. /// </summary>
  87. private string artId;
  88. private string artName;
  89. /// <summary>
  90. /// 下载地址/路径/名称等等
  91. /// 按照资源的获取/实例化类型来定义
  92. /// 如果是外部模型,此为下载链接等
  93. /// 如果是Unity基本组件,此为名称
  94. /// 如果ResourceLoad、LocalPath,AssetBundle此为路径
  95. /// </summary>
  96. private string url;
  97. /// <summary>
  98. /// 资源对应的缩略图
  99. /// </summary>
  100. private string icon;
  101. /// <summary>
  102. /// 资源类型
  103. /// </summary>
  104. private ArtType artType;
  105. /// <summary>
  106. /// 实例化方式
  107. /// </summary>
  108. private InstaceType instaceType;
  109. /// <summary>
  110. /// 资源版本
  111. /// </summary>
  112. private string version;
  113. private float size = 1;
  114. private float distance = 2;
  115. private string containerName="";
  116. private bool immediateSyn=true;
  117. private string component="";
  118. private string description="";
  119. public int AID { get => id; set => id = value; }
  120. /// <summary>
  121. /// art ID
  122. /// </summary>
  123. public string ArtId { get => artId; set => artId = value; }
  124. /// <summary>
  125. /// art Name
  126. /// </summary>
  127. public string ArtName { get => artName; set => artName = value; }
  128. /// <summary>
  129. /// art url
  130. /// </summary>
  131. public string Url { get => url; set => url = value; }
  132. /// <summary>
  133. /// art 缩略图
  134. /// </summary>
  135. public string Icon { get => icon; set => icon = value; }
  136. /// <summary>
  137. /// 资源类型,后续扩展
  138. /// 模型,图片,音视频,简单预制体等等
  139. /// </summary>
  140. public ArtType ArtType { get => artType; set => artType = value; }
  141. /// <summary>
  142. /// 创建方式,实例化方式
  143. /// </summary>
  144. public InstaceType InstaceType { get => instaceType; set => instaceType = value; }
  145. /// <summary>
  146. /// 版本
  147. /// </summary>
  148. public string Version { get => version; set => version = value; }
  149. /// <summary>
  150. /// 默认大小1
  151. /// </summary>
  152. public float Size { get => size; set => size = value; }
  153. /// <summary>
  154. /// 默认距离2
  155. /// </summary>
  156. public float Distance { get => distance; set => distance = value; }
  157. public string ContainerName { get => containerName; set => containerName = value; }
  158. /// <summary>
  159. /// 是否即时同步
  160. /// </summary>
  161. public bool ImmediateSyn { get => immediateSyn; set => immediateSyn = value; }
  162. /// <summary>
  163. /// 引用的组件
  164. /// </summary>
  165. public string Component { get => component; set => component = value; }
  166. /// <summary>
  167. /// 文件描述
  168. /// </summary>
  169. public string Description { get => description; set => description = value; }
  170. }
  171. }