This commit is contained in:
2025-06-27 00:04:26 +08:00
parent 82ee5f55a3
commit 7a5da6acc7
5 changed files with 4 additions and 8 deletions
Binary file not shown.
-4
View File
@@ -1,9 +1,5 @@
fileFormatVersion: 2
<<<<<<<< HEAD:Release/Samples~/ConfigUIElement.meta
guid: 7758a0679c9038144a4b0d007d44618f
========
guid: 85f1b523843f5884bb9f6b47500bccd0
>>>>>>>> gitea-Srouce/master:Release/Runtime/UI/TmpText.meta
folderAsset: yes
DefaultImporter:
externalObjects: {}
+3 -3
View File
@@ -30,7 +30,7 @@ namespace Deconstruction.UI.TmpText
[LabelText("点击超链接时回调")]
#endif
[SerializeField]
public UnityEvent<string> onClickLink;
public UnityEvent<string> onClickLink = new UnityEvent<string>();
/// <summary>
@@ -46,7 +46,7 @@ namespace Deconstruction.UI.TmpText
protected void Awake()
{
if (canvas == null)
transform.GetParents().Startup(transform).GetComponent(out canvas);
canvas = transform.GetParents().Startup(transform).GetComponent<Canvas>();
if (canvas == null)
{
Debug.LogError("TMP文本对象必须在Canvas下才能使用超链接功能");
@@ -160,7 +160,7 @@ namespace Deconstruction.UI.TmpText
internal void OnAnyLinkClick(string linkID)
{
onClickLink?.Invoke(linkID);
Debug.Log($"click link{linkID}");
// Debug.Log($"click link{linkID}");
// 这里不需要处理报错,应当由发送消息的成员处理
}
+1 -1
View File
@@ -26,7 +26,7 @@ namespace Deconstruction.UI.TmpText
[LabelText("点击超链接时回调")]
#endif
[SerializeField]
public UnityEvent<string> onClickLink;
public UnityEvent<string> onClickLink = new UnityEvent<string>();
private void Awake()
{
Binary file not shown.