TMP_CharacterInfo.cs 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. using UnityEngine;
  2. using UnityEngine.TextCore;
  3. namespace TMPro
  4. {
  5. public struct TMP_Vertex
  6. {
  7. public Vector3 position;
  8. public Vector2 uv;
  9. public Vector2 uv2;
  10. public Vector2 uv4;
  11. public Color32 color;
  12. //public Vector3 normal;
  13. //public Vector4 tangent;
  14. }
  15. /// <summary>
  16. /// Structure containing information about individual text elements (character or sprites).
  17. /// </summary>
  18. public struct TMP_CharacterInfo
  19. {
  20. public char character; // Should be changed to an int to handle UTF 32
  21. /// <summary>
  22. /// Index of the character in the raw string.
  23. /// </summary>
  24. public int index; // Index of the character in the input string.
  25. public int stringLength;
  26. public TMP_TextElementType elementType;
  27. public TMP_TextElement textElement;
  28. public TMP_FontAsset fontAsset;
  29. public TMP_SpriteAsset spriteAsset;
  30. public int spriteIndex;
  31. public Material material;
  32. public int materialReferenceIndex;
  33. public bool isUsingAlternateTypeface;
  34. public float pointSize;
  35. //public short wordNumber;
  36. public int lineNumber;
  37. //public short charNumber;
  38. public int pageNumber;
  39. public int vertexIndex;
  40. public TMP_Vertex vertex_BL;
  41. public TMP_Vertex vertex_TL;
  42. public TMP_Vertex vertex_TR;
  43. public TMP_Vertex vertex_BR;
  44. public Vector3 topLeft;
  45. public Vector3 bottomLeft;
  46. public Vector3 topRight;
  47. public Vector3 bottomRight;
  48. public float origin;
  49. public float ascender;
  50. public float baseLine;
  51. public float descender;
  52. public float xAdvance;
  53. public float aspectRatio;
  54. public float scale;
  55. public Color32 color;
  56. public Color32 underlineColor;
  57. public Color32 strikethroughColor;
  58. public Color32 highlightColor;
  59. public FontStyles style;
  60. public bool isVisible;
  61. //public bool isIgnoringAlignment;
  62. }
  63. }