SpineJsonData.cs 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. using System;
  2. using System.Collections.Generic;
  3. [Serializable]
  4. public class SpineAnimationData
  5. {
  6. public JSkeleton skeleton;
  7. public List<JBone> bones;
  8. public List<JSlot> slots;
  9. public List<JSkin> skins;
  10. public Dictionary<string, object> events; // 事件定义
  11. public Dictionary<string, JAnimation> animations; // 动画数据
  12. }
  13. [Serializable]
  14. public class JSkeleton
  15. {
  16. public string hash;
  17. public string spine;
  18. public float x;
  19. public float y;
  20. public float width;
  21. public float height;
  22. public string images;
  23. public string audio;
  24. }
  25. [Serializable]
  26. public class JBone
  27. {
  28. public string name;
  29. public string parent;
  30. public string icon;
  31. public float length;
  32. public float x;
  33. public float y;
  34. public float scaleX;
  35. public float scaleY;
  36. }
  37. [Serializable]
  38. public class JSlot
  39. {
  40. public string name;
  41. public string bone;
  42. public string attachment;
  43. }
  44. [Serializable]
  45. public class JSkin
  46. {
  47. public string name;
  48. public Dictionary<string, Dictionary<string, JAttachment>> attachments;
  49. }
  50. [Serializable]
  51. public class JAttachment
  52. {
  53. public float x;
  54. public float y;
  55. public float scaleX;
  56. public float scaleY;
  57. public float rotation;
  58. public float width;
  59. public float height;
  60. }
  61. [Serializable]
  62. public class JAnimation
  63. {
  64. public Dictionary<string, object> slots; // 插槽数据
  65. public Dictionary<string, object> bones; // 骨骼数据
  66. public List<JAnimationEvent> events; // 事件数据
  67. public float duration; // 动画的总时长
  68. }
  69. [Serializable]
  70. public class JAnimationEvent
  71. {
  72. public float time; // 事件发生的时间
  73. public string name; // 事件名称
  74. }