From c55fba8ab2a1c9d3df65eda4a5a1e957f4aa1f78 Mon Sep 17 00:00:00 2001 From: Andrew Lee Date: Sun, 19 Apr 2020 17:19:32 -0400 Subject: Inital commit --- .../Scripts/Runtime/TMP_TextElement.cs | 62 ++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 Library/PackageCache/com.unity.textmeshpro@2.0.1/Scripts/Runtime/TMP_TextElement.cs (limited to 'Library/PackageCache/com.unity.textmeshpro@2.0.1/Scripts/Runtime/TMP_TextElement.cs') diff --git a/Library/PackageCache/com.unity.textmeshpro@2.0.1/Scripts/Runtime/TMP_TextElement.cs b/Library/PackageCache/com.unity.textmeshpro@2.0.1/Scripts/Runtime/TMP_TextElement.cs new file mode 100644 index 0000000..ff9032d --- /dev/null +++ b/Library/PackageCache/com.unity.textmeshpro@2.0.1/Scripts/Runtime/TMP_TextElement.cs @@ -0,0 +1,62 @@ +using System; +using UnityEngine; +using UnityEngine.TextCore; + +namespace TMPro +{ + public enum TextElementType : byte + { + Character = 0x1, + Sprite = 0x2, + } + + /// + /// Base class for all text elements like Character and SpriteCharacter. + /// + [Serializable] + public class TMP_TextElement + { + /// + /// The type of text element which can be a character or sprite. + /// + public TextElementType elementType { get { return m_ElementType; } } + + /// + /// The unicode value (code point) of the character. + /// + public uint unicode { get { return m_Unicode; } set { m_Unicode = value; } } + + /// + /// The glyph used by this text element. + /// + public Glyph glyph { get { return m_Glyph; } set { m_Glyph = value; } } + + /// + /// The index of the glyph used by this text element. + /// + public uint glyphIndex { get { return m_GlyphIndex; } set { m_GlyphIndex = value; } } + + /// + /// The relative scale of the character. + /// + public float scale { get { return m_Scale; } set { m_Scale = value; } } + + // ============================================= + // Private backing fields for public properties. + // ============================================= + + [SerializeField] + protected TextElementType m_ElementType; + + [SerializeField] + private uint m_Unicode; + + private Glyph m_Glyph; + + [SerializeField] + private uint m_GlyphIndex; + + [SerializeField] + private float m_Scale; + } +} -- cgit v1.2.3