From 6e68cd8974629ccacd40f1924eb99a0cf0394de3 Mon Sep 17 00:00:00 2001 From: dgflash Date: Mon, 24 Mar 2025 10:54:39 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dtoast=E6=96=B9=E6=B3=95?= =?UTF-8?q?=E5=9C=A8=E7=BC=96=E8=BE=91=E5=99=A8=E9=A2=84=E8=A7=88=E6=A8=A1?= =?UTF-8?q?=E5=BC=8F=E4=B8=8B=E7=9A=84=E5=85=BC=E5=AE=B9=E6=80=A7=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/core/gui/layer/LayerNotify.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/assets/core/gui/layer/LayerNotify.ts b/assets/core/gui/layer/LayerNotify.ts index 74fe073..d7e4a8b 100644 --- a/assets/core/gui/layer/LayerNotify.ts +++ b/assets/core/gui/layer/LayerNotify.ts @@ -65,9 +65,11 @@ export class LayerNotify extends Node { * @param content 文本表示 * @param useI18n 是否使用多语言 */ - toast(content: string, useI18n: boolean) { + async toast(content: string, useI18n: boolean) { if (this.notify == null) { this.notify = ViewUtil.createPrefabNode(PromptResType.Toast); + // 兼容编辑器预览模式 + if (this.notify == null) this.wait = await ViewUtil.createPrefabNodeAsync(PromptResType.Toast); this.notifyItem = this.notify.children[0]; this.notifyItem.parent = null; } From fc311f5337b6c0f6dec8ae5c21b70d3a481422ab Mon Sep 17 00:00:00 2001 From: dgflash Date: Mon, 24 Mar 2025 10:55:42 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E5=A4=8DLayerNotify=E4=B8=ADnotif?= =?UTF-8?q?y=E5=8F=98=E9=87=8F=E6=9C=AA=E6=AD=A3=E7=A1=AE=E8=B5=8B?= =?UTF-8?q?=E5=80=BC=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/core/gui/layer/LayerNotify.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/core/gui/layer/LayerNotify.ts b/assets/core/gui/layer/LayerNotify.ts index d7e4a8b..b5aa1d7 100644 --- a/assets/core/gui/layer/LayerNotify.ts +++ b/assets/core/gui/layer/LayerNotify.ts @@ -69,7 +69,7 @@ export class LayerNotify extends Node { if (this.notify == null) { this.notify = ViewUtil.createPrefabNode(PromptResType.Toast); // 兼容编辑器预览模式 - if (this.notify == null) this.wait = await ViewUtil.createPrefabNodeAsync(PromptResType.Toast); + if (this.notify == null) this.notify = await ViewUtil.createPrefabNodeAsync(PromptResType.Toast); this.notifyItem = this.notify.children[0]; this.notifyItem.parent = null; }