ArtContainer.cs 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. using ShadowStudio.Tool;
  2. using System;
  3. using System.Collections;
  4. using System.Collections.Generic;
  5. using UnityEngine;
  6. namespace ShadowStudio.Model
  7. {
  8. /// <summary>
  9. /// 美术资源容器
  10. /// </summary>
  11. public interface ArtContainer
  12. {
  13. /// <summary>
  14. /// 获取物体的信息
  15. /// </summary>
  16. /// <returns></returns>
  17. GoodsInfo GetGoodsInfo();
  18. void AddArtComponent(ArtComponent component);
  19. /// <summary>
  20. /// 添加到容器
  21. /// </summary>
  22. /// <param name="art"></param>
  23. void AddToContainer(UnityEngine.Object art, ArtInfo info);
  24. /// <summary>
  25. /// 获取容器类型
  26. /// </summary>
  27. /// <returns></returns>
  28. ArtType GetArtType();
  29. /// <summary>
  30. /// 获取容器的实例
  31. /// </summary>
  32. /// <returns></returns>
  33. GameObject GetInstace();
  34. /// <summary>
  35. /// 销毁容器
  36. /// </summary>
  37. void DestroyArt();
  38. /// <summary>
  39. /// 设置当前的容器的显示或隐藏
  40. /// </summary>
  41. /// <param name="isShow"></param>
  42. void SetArtActive(bool isShow);
  43. /// <summary>
  44. /// 播放动效
  45. /// </summary>
  46. void PlayEffect();
  47. /// <summary>
  48. /// 发送当前的姿态
  49. /// 此函数已失效,请使用SendTransfer(int state, int status);
  50. /// </summary>
  51. //void SendTransfer(int state, bool isEditting);
  52. void SendTransfer(int state, int status);
  53. /// <summary>
  54. /// 同步容器的状态
  55. /// </summary>
  56. void TransferSyn(GoodsInfo goods, bool smooth = true);
  57. /// <summary>
  58. /// 锁定此容器
  59. /// </summary>
  60. void LockContainer();
  61. /// <summary>
  62. /// 解锁此容器
  63. /// </summary>
  64. void UnLockContainer();
  65. /// <summary>
  66. /// 能否被编辑
  67. /// </summary>
  68. /// <returns></returns>
  69. bool CanEditor();
  70. /// <summary>
  71. /// 获取容器的缩略图
  72. /// </summary>
  73. /// <returns></returns>
  74. Texture GetContainerIcon();
  75. void GetContainerIcon(Action<Texture> load);
  76. /// <summary>
  77. /// 设置资源的帮助实例化类
  78. /// </summary>
  79. /// <param name="handler"></param>
  80. void SetArtHandler(ArtHandler handler);
  81. /// <summary>
  82. /// 设置物体选中状态
  83. /// </summary>
  84. void SetSelect();
  85. /// <summary>
  86. /// 设置物体非选中状态
  87. /// </summary>
  88. void UnSetSelect();
  89. /// <summary>
  90. /// 重置编辑菜单的位置
  91. /// </summary>
  92. void ResetEditorPosition();
  93. /// <summary>
  94. /// 获取物体编辑节点
  95. /// </summary>
  96. /// <returns></returns>
  97. Transform GetEditorCenter();
  98. /// <summary>
  99. /// 后退
  100. /// </summary>
  101. bool GoBack();
  102. /// <summary>
  103. /// 前进
  104. /// </summary>
  105. bool GoAhead();
  106. /// <summary>
  107. /// 获取可后退的步数
  108. /// </summary>
  109. /// <returns></returns>
  110. int BackCount();
  111. /// <summary>
  112. /// 获取可前进的步数
  113. /// </summary>
  114. /// <returns></returns>
  115. int AheadCount();
  116. /// <summary>
  117. /// 克隆此物体
  118. /// </summary>
  119. void CloneContainer();
  120. /// <summary>
  121. /// 物体的坐标,本地相对坐标
  122. /// </summary>
  123. Vector3 Position { get; set; }
  124. /// <summary>
  125. /// 物体的角度,本地相对角度
  126. /// </summary>
  127. Vector3 Angle { get; set; }
  128. /// <summary>
  129. /// 物体的缩放值
  130. /// </summary>
  131. Vector3 Scale { get; set; }
  132. /// <summary>
  133. /// 此物体距离头部的距离
  134. /// </summary>
  135. float Distance { get; }
  136. /// <summary>
  137. /// 物体的透明度
  138. /// </summary>
  139. float Alpha { get; set; }
  140. /// <summary>
  141. /// 物体的颜色值
  142. /// </summary>
  143. Color GoodsColor { get; set; }
  144. /// <summary>
  145. /// 物体编辑
  146. /// </summary>
  147. TransferCell Transfer { get; set; }
  148. ArtComponent ArtComponent{ get; }
  149. void UpdateProcess(float process);
  150. }
  151. }