NewMyBook/Assets/script/AIquestionAnswer.cs
2025-03-28 16:07:42 +08:00

42 lines
946 B
C#

using System.Collections.Generic;
using TMPro;
using UnityEngine;
using UnityEngine.EventSystems;
using System.Text.RegularExpressions;
using UnityEngine.Video;
public class AIquestionAnswer : MonoBehaviour, IPointerClickHandler
{
private TextMeshProUGUI m_TextMeshProUGUI;
// Start is called before the first frame update
private void Awake()
{
m_TextMeshProUGUI = GetComponent<TextMeshProUGUI>();
}
void Start()
{
}
// Update is called once per frame
void Update()
{
}
public void OnPointerClick(PointerEventData eventData)
{
// 获取鼠标点击的超链接索引
int linkIndex = TMP_TextUtilities.FindIntersectingLink(m_TextMeshProUGUI, eventData.position, eventData.pressEventCamera);
print(linkIndex);
if (linkIndex != -1)
{
Debug.Log("jjjjjjjjjjjjjjjjjjjj");
}
}
}