Example #1
0
        public void OnPointerClick(PointerEventData eventData)
        {
            if (!linkObject || OriginText.Length < 1)
            {
                return;
            }

            Vector2 localPos;
            bool    ret = RectTransformUtility.ScreenPointToLocalPointInRectangle(cachedTransform, eventData.position, eventData.pressEventCamera, out localPos);

            if (!ret)
            {
                return;
            }

#if UNITY_5_2 || UNITY_5_3_OR_NEWER || UNITY_5_4
            if (mVertexHelper.currentVertCount < 1)
#else
            if (vbo.Count < 1)
#endif
            { updateVBO(); }


#if UNITY_5_2 || UNITY_5_3_OR_NEWER || UNITY_5_4
            int textIndex = UGUIText_Extend.GetExactCharacterIndex(mVertexHelper, localPos);
#else
            int textIndex = UGUIText_Extend.GetExactCharacterIndex(vbo, localPos);
#endif

            if (textIndex < 0)
            {
                return;
            }

            if (mOriginIndexList.Count <= textIndex)
            {
                return;
            }

            int originIndex = mOriginIndexList[textIndex];
            TxtTool.ProcessLinkObjectText(OriginText, originIndex);
        }