This commit is contained in:
dgflash
2025-03-25 20:21:12 +08:00

View File

@@ -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.notify = await ViewUtil.createPrefabNodeAsync(PromptResType.Toast);
this.notifyItem = this.notify.children[0];
this.notifyItem.parent = null;
}