A game about forced loneliness, made by TACStudios
at master 69 lines 2.0 kB view raw
1using System; 2using UnityEngine; 3using UnityEngine.TextCore; 4 5namespace TMPro 6{ 7 public enum TextElementType : byte 8 { 9 Character = 0x1, 10 Sprite = 0x2, 11 } 12 13 /// <summary> 14 /// Base class for all text elements like Character and SpriteCharacter. 15 /// </summary> 16 [Serializable] 17 public class TMP_TextElement 18 { 19 /// <summary> 20 /// The type of text element which can be a character or sprite. 21 /// </summary> 22 public TextElementType elementType { get { return m_ElementType; } } 23 24 /// <summary> 25 /// The unicode value (code point) of the character. 26 /// </summary> 27 public uint unicode { get { return m_Unicode; } set { m_Unicode = value; } } 28 29 /// <summary> 30 /// The Text Asset to which this Text Element belongs. 31 /// </summary> 32 public TMP_Asset textAsset { get { return m_TextAsset; } set { m_TextAsset = value; } } 33 34 /// <summary> 35 /// The glyph used by this text element. 36 /// </summary> 37 public Glyph glyph { get { return m_Glyph; } set { m_Glyph = value; } } 38 39 /// <summary> 40 /// The index of the glyph used by this text element. 41 /// </summary> 42 public uint glyphIndex { get { return m_GlyphIndex; } set { m_GlyphIndex = value; } } 43 44 /// <summary> 45 /// The relative scale of the character. 46 /// </summary> 47 public float scale { get { return m_Scale; } set { m_Scale = value; } } 48 49 // ============================================= 50 // Private backing fields for public properties. 51 // ============================================= 52 53 [SerializeField] 54 internal TextElementType m_ElementType; 55 56 [SerializeField] 57 internal uint m_Unicode; 58 59 internal TMP_Asset m_TextAsset; 60 61 internal Glyph m_Glyph; 62 63 [SerializeField] 64 internal uint m_GlyphIndex; 65 66 [SerializeField] 67 internal float m_Scale; 68 } 69}