protected virtual bool ParseInputTextAndEmojiCharSequence()
        {
            m_emojiParsingRequired = false;

            //Only parse when richtext active (we need the <sprite=index> tag)
            if (m_isRichText)
            {
                var v_parsedEmoji = false;
                var v_oldText     = m_text;

                /*//Parse Sprite Chars
                 * ParseInputText();
                 *
                 * //Parse Emojis
                 * m_text = CharBufferToString(); //Pick the char unicodes to parse the emojis
                 * v_parsedEmoji = TMP_EmojiSearchEngine.ParseEmojiCharSequence(spriteAsset, ref m_text);
                 *
                 * //Apply parsed Emoji to char buffer
                 * if (v_parsedEmoji)
                 * {
                 *  StringToCharArray(m_text, ref m_char_buffer);
                 *  SetArraySizes(m_char_buffer);
                 * }*/

                v_parsedEmoji = TMP_EmojiSearchEngine.ParseEmojiCharSequence(spriteAsset, ref m_text);

                m_emojiParsingRequired          = false;
                IsInputParsingRequired_Internal = false;

#if !UNITY_2018_3_OR_NEWER
                m_inputSource = TextInputSources.Text;
#endif
                ParseInputText();

                m_emojiParsingRequired          = false;
                IsInputParsingRequired_Internal = false;

                //Debug.Log("ParseInputTextAndEmojiCharSequence");
                //We must revert the original text because we dont want to permanently change the text
                m_text = v_oldText;

                m_isCalculateSizeRequired = true;

                return(v_parsedEmoji);
            }

            return(false);
        }
예제 #2
0
        protected virtual bool ParseInputTextAndEmojiCharSequence()
        {
            m_emojiParsingRequired = false;

            //Only parse when richtext active (we need the <sprite=index> tag)
            if (m_isRichText)
            {
                m_emojiParsingRequired    = false;
                m_isCalculateSizeRequired = true;

                var v_parsedEmoji = false;
                var v_oldText     = m_text;
                v_parsedEmoji = TMP_EmojiSearchEngine.ParseEmojiCharSequence(spriteAsset, ref m_text);
                ParseInputText();

                //We must revert the original text because we dont want to permanently change the text
                m_text = v_oldText;

                return(v_parsedEmoji);
            }

            return(false);
        }
 public override TMP_TextInfo GetTextInfo(string text)
 {
     TMP_EmojiSearchEngine.ParseEmojiCharSequence(spriteAsset, ref text);
     return(base.GetTextInfo(text));
 }