暂无描述
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

SpriteLibraryDataProvider.cs 3.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. using System;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using UnityEngine.Serialization;
  5. namespace UnityEditor.U2D.Animation
  6. {
  7. /// <summary>
  8. /// Structure that defines a Sprite Library Category Label
  9. /// </summary>
  10. [Serializable]
  11. public struct SpriteCategoryLabel
  12. {
  13. [SerializeField]
  14. string m_Name;
  15. [SerializeField]
  16. string m_SpriteId;
  17. /// <summary>
  18. /// Get and set the name for the Sprite label
  19. /// </summary>
  20. public string name
  21. {
  22. get { return m_Name; }
  23. set { m_Name = value; }
  24. }
  25. /// <summary>
  26. /// Get and set the Sprite Id.
  27. /// </summary>
  28. public string spriteId
  29. {
  30. get { return m_SpriteId; }
  31. set { m_SpriteId = value; }
  32. }
  33. }
  34. /// <summary>
  35. /// Structure that defines a Sprite Library Category.
  36. /// </summary>
  37. [Serializable]
  38. public struct SpriteCategory
  39. {
  40. [SerializeField]
  41. [FormerlySerializedAs("name")]
  42. string m_Name;
  43. [SerializeField]
  44. List<SpriteCategoryLabel> m_Labels;
  45. /// <summary>
  46. /// Get and set the name for the Sprite Category
  47. /// </summary>
  48. public string name
  49. {
  50. get { return m_Name; }
  51. set { m_Name = value; }
  52. }
  53. /// <summary>
  54. /// Get and set the Sprites registered to this category.
  55. /// </summary>
  56. public List<SpriteCategoryLabel> labels
  57. {
  58. get { return m_Labels; }
  59. set { m_Labels = value; }
  60. }
  61. }
  62. /// <summary>
  63. /// A structure to hold a collection of SpriteCategory
  64. /// </summary>
  65. [Serializable]
  66. public struct SpriteCategoryList
  67. {
  68. [SerializeField]
  69. [FormerlySerializedAs("categories")]
  70. List<SpriteCategory> m_Categories;
  71. /// <summary>
  72. /// Get or set the a list of SpriteCategory
  73. /// </summary>
  74. public List<SpriteCategory> categories
  75. {
  76. get { return m_Categories; }
  77. set { m_Categories = value; }
  78. }
  79. }
  80. /// <summary>An interface that allows Sprite Editor Modules to edit Sprite Library data for user custom importer.</summary>
  81. /// <remarks>Implement this interface for [[ScriptedImporter]] to leverage on Sprite Editor Modules to edit Sprite Library data.</remarks>
  82. [Obsolete("The interface is no longer used")]
  83. public interface ISpriteLibDataProvider
  84. {
  85. /// <summary>
  86. /// Returns the SpriteCategoryList structure that represents the Sprite Library data.
  87. /// </summary>
  88. /// <returns>SpriteCategoryList data</returns>
  89. SpriteCategoryList GetSpriteCategoryList();
  90. /// <summary>
  91. /// Sets the SpriteCategoryList structure that represents the Sprite Library data to the data provider
  92. /// </summary>
  93. /// <param name="spriteCategoryList">Data to set</param>
  94. void SetSpriteCategoryList(SpriteCategoryList spriteCategoryList);
  95. }
  96. }