From a49408761daa18308ff8fcb4eaaa2b742b2ca8a6 Mon Sep 17 00:00:00 2001 From: rh Date: Thu, 13 Mar 2025 09:25:20 +0800 Subject: [PATCH] fixed --- dist/main.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/dist/main.js b/dist/main.js index a1318ba..de4fbcb 100644 --- a/dist/main.js +++ b/dist/main.js @@ -387,7 +387,13 @@ exports.methods = { } // 预制体资源 else if (type === 'cc.Prefab') { - const uuid = source[source.length - 1]['asset']['__uuid__']; + let uuid = undefined; + for (let i = source.length - 1; i >= 0; i--) { + if (source[i]['asset']) { + uuid = source[i]['asset']['__uuid__']; + break; + } + } nodeTree['__type__'] = 'cc.Prefab'; // 类型 nodeTree['__uuid__'] = uuid; // uuid // 从根节点开始读取