refactor: Update Unity to 2022.3.62
This commit is contained in:
@@ -1303,7 +1303,7 @@ namespace TMPro
|
||||
/// <param name="text">The source text that contains the missing character.</param>
|
||||
/// <param name="fontAsset">The font asset that is missing the requested characters.</param>
|
||||
/// <param name="textComponent">The text component where the requested character is missing.</param>
|
||||
public delegate void MissingCharacterEventCallback(int unicode, int stringIndex, string text, FontAsset fontAsset, TMP_Text textComponent);
|
||||
public delegate void MissingCharacterEventCallback(uint unicode, int stringIndex, string text, FontAsset fontAsset, TMP_Text textComponent);
|
||||
|
||||
/// <summary>
|
||||
/// Event delegate to be called when the requested Unicode character is missing from the font asset.
|
||||
@@ -1512,7 +1512,7 @@ namespace TMPro
|
||||
[System.Diagnostics.DebuggerDisplay("Unicode ({unicode}) '{(char)unicode}'")]
|
||||
internal struct UnicodeChar
|
||||
{
|
||||
public int unicode;
|
||||
public uint unicode;
|
||||
public int stringIndex;
|
||||
public int length;
|
||||
}
|
||||
@@ -2120,11 +2120,11 @@ namespace TMPro
|
||||
|
||||
if (writeIndex + 2 > m_TextProcessingArray.Length) ResizeInternalArray(ref m_TextProcessingArray);
|
||||
|
||||
m_TextProcessingArray[writeIndex].unicode = (int)m_TextBackingArray[readIndex + 1];
|
||||
m_TextProcessingArray[writeIndex].unicode = m_TextBackingArray[readIndex + 1];
|
||||
m_TextProcessingArray[writeIndex].stringIndex = readIndex;
|
||||
m_TextProcessingArray[writeIndex].length = 1;
|
||||
|
||||
m_TextProcessingArray[writeIndex + 1].unicode = (int)m_TextBackingArray[readIndex + 2];
|
||||
m_TextProcessingArray[writeIndex + 1].unicode = m_TextBackingArray[readIndex + 2];
|
||||
m_TextProcessingArray[writeIndex + 1].stringIndex = readIndex;
|
||||
m_TextProcessingArray[writeIndex + 1].length = 1;
|
||||
|
||||
@@ -2215,7 +2215,7 @@ namespace TMPro
|
||||
{
|
||||
if (writeIndex == m_TextProcessingArray.Length) ResizeInternalArray(ref m_TextProcessingArray);
|
||||
|
||||
m_TextProcessingArray[writeIndex].unicode = (int)TMP_TextParsingUtilities.ConvertToUTF32(c, m_TextBackingArray[readIndex + 1]);
|
||||
m_TextProcessingArray[writeIndex].unicode = TMP_TextParsingUtilities.ConvertToUTF32(c, m_TextBackingArray[readIndex + 1]);
|
||||
m_TextProcessingArray[writeIndex].stringIndex = readIndex;
|
||||
m_TextProcessingArray[writeIndex].length = 2;
|
||||
|
||||
@@ -2305,7 +2305,7 @@ namespace TMPro
|
||||
|
||||
if (writeIndex == m_TextProcessingArray.Length) ResizeInternalArray(ref m_TextProcessingArray);
|
||||
|
||||
m_TextProcessingArray[writeIndex].unicode = (int)c;
|
||||
m_TextProcessingArray[writeIndex].unicode = c;
|
||||
m_TextProcessingArray[writeIndex].stringIndex = readIndex;
|
||||
m_TextProcessingArray[writeIndex].length = 1;
|
||||
|
||||
@@ -2811,11 +2811,11 @@ namespace TMPro
|
||||
int styleLength = style.styleOpeningTagArray.Length;
|
||||
|
||||
// Replace <style> tag with opening definition
|
||||
int[] tagDefinition = style.styleOpeningTagArray;
|
||||
uint[] tagDefinition = style.styleOpeningTagArray;
|
||||
|
||||
for (int i = 0; i < styleLength; i++)
|
||||
{
|
||||
int c = tagDefinition[i];
|
||||
uint c = tagDefinition[i];
|
||||
|
||||
if (c == '\\' && i + 1 < styleLength)
|
||||
{
|
||||
@@ -2922,7 +2922,7 @@ namespace TMPro
|
||||
/// <param name="charBuffer"></param>
|
||||
/// <param name="writeIndex"></param>
|
||||
/// <returns></returns>
|
||||
bool ReplaceOpeningStyleTag(ref int[] sourceText, int srcIndex, out int srcOffset, ref UnicodeChar[] charBuffer, ref int writeIndex)
|
||||
bool ReplaceOpeningStyleTag(ref uint[] sourceText, int srcIndex, out int srcOffset, ref UnicodeChar[] charBuffer, ref int writeIndex)
|
||||
{
|
||||
// Validate <style> tag.
|
||||
int styleHashCode = GetStyleHashCode(ref sourceText, srcIndex + 7, out srcOffset);
|
||||
@@ -2940,11 +2940,11 @@ namespace TMPro
|
||||
int styleLength = style.styleOpeningTagArray.Length;
|
||||
|
||||
// Replace <style> tag with opening definition
|
||||
int[] tagDefinition = style.styleOpeningTagArray;
|
||||
uint[] tagDefinition = style.styleOpeningTagArray;
|
||||
|
||||
for (int i = 0; i < styleLength; i++)
|
||||
{
|
||||
int c = tagDefinition[i];
|
||||
uint c = tagDefinition[i];
|
||||
|
||||
if (c == '\\' && i + 1 < styleLength)
|
||||
{
|
||||
@@ -3066,11 +3066,11 @@ namespace TMPro
|
||||
int styleLength = style.styleClosingTagArray.Length;
|
||||
|
||||
// Replace <style> tag with opening definition
|
||||
int[] tagDefinition = style.styleClosingTagArray;
|
||||
uint[] tagDefinition = style.styleClosingTagArray;
|
||||
|
||||
for (int i = 0; i < styleLength; i++)
|
||||
{
|
||||
int c = tagDefinition[i];
|
||||
uint c = tagDefinition[i];
|
||||
|
||||
if (c == '\\' && i + 1 < styleLength)
|
||||
{
|
||||
@@ -3174,7 +3174,7 @@ namespace TMPro
|
||||
/// <param name="charBuffer"></param>
|
||||
/// <param name="writeIndex"></param>
|
||||
/// <returns></returns>
|
||||
void ReplaceClosingStyleTag(ref int[] sourceText, int srcIndex, ref UnicodeChar[] charBuffer, ref int writeIndex)
|
||||
void ReplaceClosingStyleTag(ref uint[] sourceText, int srcIndex, ref UnicodeChar[] charBuffer, ref int writeIndex)
|
||||
{
|
||||
// Get style from the Style Stack
|
||||
int styleHashCode = m_TextStyleStacks[m_TextStyleStackDepth + 1].Pop();
|
||||
@@ -3189,11 +3189,11 @@ namespace TMPro
|
||||
int styleLength = style.styleClosingTagArray.Length;
|
||||
|
||||
// Replace <style> tag with opening definition
|
||||
int[] tagDefinition = style.styleClosingTagArray;
|
||||
uint[] tagDefinition = style.styleClosingTagArray;
|
||||
|
||||
for (int i = 0; i < styleLength; i++)
|
||||
{
|
||||
int c = tagDefinition[i];
|
||||
uint c = tagDefinition[i];
|
||||
|
||||
if (c == '\\' && i + 1 < styleLength)
|
||||
{
|
||||
@@ -3308,11 +3308,11 @@ namespace TMPro
|
||||
int styleLength = style.styleOpeningTagArray.Length;
|
||||
|
||||
// Replace <style> tag with opening definition
|
||||
int[] tagDefinition = style.styleOpeningTagArray;
|
||||
uint[] tagDefinition = style.styleOpeningTagArray;
|
||||
|
||||
for (int i = 0; i < styleLength; i++)
|
||||
{
|
||||
int c = tagDefinition[i];
|
||||
uint c = tagDefinition[i];
|
||||
|
||||
if (c == '\\' && i + 1 < styleLength)
|
||||
{
|
||||
@@ -3424,11 +3424,11 @@ namespace TMPro
|
||||
int styleLength = style.styleClosingTagArray.Length;
|
||||
|
||||
// Replace <style> tag with opening definition
|
||||
int[] tagDefinition = style.styleClosingTagArray;
|
||||
uint[] tagDefinition = style.styleClosingTagArray;
|
||||
|
||||
for (int i = 0; i < styleLength; i++)
|
||||
{
|
||||
int c = tagDefinition[i];
|
||||
uint c = tagDefinition[i];
|
||||
|
||||
if (c == '\\' && i + 1 < styleLength)
|
||||
{
|
||||
@@ -3531,7 +3531,7 @@ namespace TMPro
|
||||
/// <param name="tagDefinition"></param>
|
||||
/// <param name="readIndex"></param>
|
||||
/// <returns></returns>
|
||||
int GetMarkupTagHashCode(int[] tagDefinition, int readIndex)
|
||||
int GetMarkupTagHashCode(uint[] tagDefinition, int readIndex)
|
||||
{
|
||||
int hashCode = 0;
|
||||
int maxReadIndex = readIndex + 16;
|
||||
@@ -3539,7 +3539,7 @@ namespace TMPro
|
||||
|
||||
for (; readIndex < maxReadIndex && readIndex < tagDefinitionLength; readIndex++)
|
||||
{
|
||||
int c = tagDefinition[readIndex];
|
||||
uint c = tagDefinition[readIndex];
|
||||
|
||||
if (c == '>' || c == '=' || c == ' ')
|
||||
return hashCode;
|
||||
@@ -3584,7 +3584,7 @@ namespace TMPro
|
||||
/// <param name="index"></param>
|
||||
/// <param name="closeIndex"></param>
|
||||
/// <returns></returns>
|
||||
int GetStyleHashCode(ref int[] text, int index, out int closeIndex)
|
||||
int GetStyleHashCode(ref uint[] text, int index, out int closeIndex)
|
||||
{
|
||||
int hashCode = 0;
|
||||
closeIndex = 0;
|
||||
@@ -4184,7 +4184,7 @@ namespace TMPro
|
||||
// Parse through Character buffer to read HTML tags and begin creating mesh.
|
||||
for (int i = 0; i < m_TextProcessingArray.Length && m_TextProcessingArray[i].unicode != 0; i++)
|
||||
{
|
||||
int charCode = m_TextProcessingArray[i].unicode;
|
||||
uint charCode = m_TextProcessingArray[i].unicode;
|
||||
|
||||
// Parse Rich Text Tag
|
||||
#region Parse Rich Text Tag
|
||||
@@ -4223,7 +4223,7 @@ namespace TMPro
|
||||
|
||||
if (characterToSubstitute.index == m_characterCount)
|
||||
{
|
||||
charCode = (int)characterToSubstitute.unicode;
|
||||
charCode = characterToSubstitute.unicode;
|
||||
m_textElementType = TMP_TextElementType.Character;
|
||||
isInjectingCharacter = true;
|
||||
|
||||
@@ -4316,7 +4316,7 @@ namespace TMPro
|
||||
|
||||
// Sprites are assigned in the E000 Private Area + sprite Index
|
||||
if (charCode == 60)
|
||||
charCode = 57344 + m_spriteIndex;
|
||||
charCode = 57344 + (uint)m_spriteIndex;
|
||||
|
||||
// The sprite scale calculations are based on the font asset assigned to the text object.
|
||||
if (m_currentSpriteAsset.faceInfo.pointSize > 0)
|
||||
@@ -6523,7 +6523,7 @@ namespace TMPro
|
||||
targetTextComponent.parentLinkedComponent = null;
|
||||
}
|
||||
|
||||
protected void DoMissingGlyphCallback(int unicode, int stringIndex, FontAsset fontAsset)
|
||||
protected void DoMissingGlyphCallback(uint unicode, int stringIndex, FontAsset fontAsset)
|
||||
{
|
||||
// Event to allow users to modify the content of the text info before the text is rendered.
|
||||
OnMissingCharacter?.Invoke(unicode, stringIndex, m_text, fontAsset, this);
|
||||
@@ -6630,7 +6630,7 @@ namespace TMPro
|
||||
/// </summary>
|
||||
/// <param name="hex"></param>
|
||||
/// <returns></returns>
|
||||
protected int HexToInt(char hex)
|
||||
protected uint HexToInt(char hex)
|
||||
{
|
||||
switch (hex)
|
||||
{
|
||||
@@ -6677,9 +6677,9 @@ namespace TMPro
|
||||
/// </summary>
|
||||
/// <returns>The Unicode hex.</returns>
|
||||
/// <param name="i">The index.</param>
|
||||
protected int GetUTF16(string text, int i)
|
||||
protected uint GetUTF16(string text, int i)
|
||||
{
|
||||
int unicode = 0;
|
||||
uint unicode = 0;
|
||||
unicode += HexToInt(text[i]) << 12;
|
||||
unicode += HexToInt(text[i + 1]) << 8;
|
||||
unicode += HexToInt(text[i + 2]) << 4;
|
||||
@@ -6687,9 +6687,9 @@ namespace TMPro
|
||||
return unicode;
|
||||
}
|
||||
|
||||
protected int GetUTF16(int[] text, int i)
|
||||
protected uint GetUTF16(int[] text, int i)
|
||||
{
|
||||
int unicode = 0;
|
||||
uint unicode = 0;
|
||||
unicode += HexToInt((char)text[i]) << 12;
|
||||
unicode += HexToInt((char)text[i + 1]) << 8;
|
||||
unicode += HexToInt((char)text[i + 2]) << 4;
|
||||
@@ -6697,9 +6697,9 @@ namespace TMPro
|
||||
return unicode;
|
||||
}
|
||||
|
||||
internal int GetUTF16(uint[] text, int i)
|
||||
internal uint GetUTF16(uint[] text, int i)
|
||||
{
|
||||
int unicode = 0;
|
||||
uint unicode = 0;
|
||||
unicode += HexToInt((char)text[i]) << 12;
|
||||
unicode += HexToInt((char)text[i + 1]) << 8;
|
||||
unicode += HexToInt((char)text[i + 2]) << 4;
|
||||
@@ -6712,9 +6712,9 @@ namespace TMPro
|
||||
/// </summary>
|
||||
/// <returns>The Unicode hex.</returns>
|
||||
/// <param name="i">The index.</param>
|
||||
protected int GetUTF16(StringBuilder text, int i)
|
||||
protected uint GetUTF16(StringBuilder text, int i)
|
||||
{
|
||||
int unicode = 0;
|
||||
uint unicode = 0;
|
||||
unicode += HexToInt(text[i]) << 12;
|
||||
unicode += HexToInt(text[i + 1]) << 8;
|
||||
unicode += HexToInt(text[i + 2]) << 4;
|
||||
@@ -6722,9 +6722,9 @@ namespace TMPro
|
||||
return unicode;
|
||||
}
|
||||
|
||||
private int GetUTF16(TextBackingContainer text, int i)
|
||||
private uint GetUTF16(TextBackingContainer text, int i)
|
||||
{
|
||||
int unicode = 0;
|
||||
uint unicode = 0;
|
||||
unicode += HexToInt((char)text[i]) << 12;
|
||||
unicode += HexToInt((char)text[i + 1]) << 8;
|
||||
unicode += HexToInt((char)text[i + 2]) << 4;
|
||||
@@ -6749,9 +6749,9 @@ namespace TMPro
|
||||
/// </summary>
|
||||
/// <returns>The Unicode hex.</returns>
|
||||
/// <param name="i">The index.</param>
|
||||
protected int GetUTF32(string text, int i)
|
||||
protected uint GetUTF32(string text, int i)
|
||||
{
|
||||
int unicode = 0;
|
||||
uint unicode = 0;
|
||||
unicode += HexToInt(text[i]) << 28;
|
||||
unicode += HexToInt(text[i + 1]) << 24;
|
||||
unicode += HexToInt(text[i + 2]) << 20;
|
||||
@@ -6763,9 +6763,9 @@ namespace TMPro
|
||||
return unicode;
|
||||
}
|
||||
|
||||
protected int GetUTF32(int[] text, int i)
|
||||
protected uint GetUTF32(int[] text, int i)
|
||||
{
|
||||
int unicode = 0;
|
||||
uint unicode = 0;
|
||||
unicode += HexToInt((char)text[i]) << 28;
|
||||
unicode += HexToInt((char)text[i + 1]) << 24;
|
||||
unicode += HexToInt((char)text[i + 2]) << 20;
|
||||
@@ -6777,9 +6777,9 @@ namespace TMPro
|
||||
return unicode;
|
||||
}
|
||||
|
||||
internal int GetUTF32(uint[] text, int i)
|
||||
internal uint GetUTF32(uint[] text, int i)
|
||||
{
|
||||
int unicode = 0;
|
||||
uint unicode = 0;
|
||||
unicode += HexToInt((char)text[i]) << 28;
|
||||
unicode += HexToInt((char)text[i + 1]) << 24;
|
||||
unicode += HexToInt((char)text[i + 2]) << 20;
|
||||
@@ -6796,9 +6796,9 @@ namespace TMPro
|
||||
/// </summary>
|
||||
/// <returns>The Unicode hex.</returns>
|
||||
/// <param name="i">The index.</param>
|
||||
protected int GetUTF32(StringBuilder text, int i)
|
||||
protected uint GetUTF32(StringBuilder text, int i)
|
||||
{
|
||||
int unicode = 0;
|
||||
uint unicode = 0;
|
||||
unicode += HexToInt(text[i]) << 28;
|
||||
unicode += HexToInt(text[i + 1]) << 24;
|
||||
unicode += HexToInt(text[i + 2]) << 20;
|
||||
@@ -6810,9 +6810,9 @@ namespace TMPro
|
||||
return unicode;
|
||||
}
|
||||
|
||||
int GetUTF32(TextBackingContainer text, int i)
|
||||
uint GetUTF32(TextBackingContainer text, int i)
|
||||
{
|
||||
int unicode = 0;
|
||||
uint unicode = 0;
|
||||
unicode += HexToInt((char)text[i]) << 28;
|
||||
unicode += HexToInt((char)text[i + 1]) << 24;
|
||||
unicode += HexToInt((char)text[i + 2]) << 20;
|
||||
@@ -7093,7 +7093,7 @@ namespace TMPro
|
||||
|
||||
for (int i = startIndex; i < chars.Length && chars[i].unicode != 0 && tagCharCount < m_htmlTag.Length && chars[i].unicode != '<'; i++)
|
||||
{
|
||||
int unicode = chars[i].unicode;
|
||||
uint unicode = chars[i].unicode;
|
||||
|
||||
if (unicode == '>') // ASCII Code of End HTML tag '>'
|
||||
{
|
||||
|
Reference in New Issue
Block a user