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