This commit is contained in:
2025-06-26 10:55:14 +08:00
parent 5883801f6e
commit 82ee5f55a3
2 changed files with 3 additions and 7 deletions
+2 -4
View File
@@ -30,10 +30,9 @@ namespace Deconstruction.UI.TmpText
[LabelText("点击超链接时回调")] [LabelText("点击超链接时回调")]
#endif #endif
[SerializeField] [SerializeField]
private UnityEvent<string> _onClickLink; public UnityEvent<string> onClickLink;
public Action<string> onClickLink;
/// <summary> /// <summary>
/// 当前摄像机 /// 当前摄像机
/// </summary> /// </summary>
@@ -161,7 +160,6 @@ namespace Deconstruction.UI.TmpText
internal void OnAnyLinkClick(string linkID) internal void OnAnyLinkClick(string linkID)
{ {
onClickLink?.Invoke(linkID); onClickLink?.Invoke(linkID);
_onClickLink.Invoke(linkID);
Debug.Log($"click link{linkID}"); Debug.Log($"click link{linkID}");
// 这里不需要处理报错,应当由发送消息的成员处理 // 这里不需要处理报错,应当由发送消息的成员处理
} }
+1 -3
View File
@@ -26,8 +26,7 @@ namespace Deconstruction.UI.TmpText
[LabelText("点击超链接时回调")] [LabelText("点击超链接时回调")]
#endif #endif
[SerializeField] [SerializeField]
private UnityEvent<string> _onClickLink; public UnityEvent<string> onClickLink;
public Action<string> onClickLink;
private void Awake() private void Awake()
{ {
@@ -54,7 +53,6 @@ namespace Deconstruction.UI.TmpText
try try
{ {
onClickLink?.Invoke(linkID); onClickLink?.Invoke(linkID);
_onClickLink.Invoke(linkID);
manager.OnAnyLinkClick(linkID); manager.OnAnyLinkClick(linkID);
} }
catch (Exception e) catch (Exception e)