From 5514366af72c95c4eef2103a8edf1f6a571da07f Mon Sep 17 00:00:00 2001 From: Joywayer Date: Tue, 1 Sep 2026 06:32:10 +0800 Subject: [PATCH] =?UTF-8?q?fix(ui):=20=E9=87=8D=E5=BB=BA=20PlayerInfoView?= =?UTF-8?q?=5FRuntime=20=E7=BA=AF=E8=8A=82=E7=82=B9=E7=89=88,=E5=88=A0?= =?UTF-8?q?=E8=84=8F=20prefab?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 之前 PlayerInfoView.prefab importer 报 _name undefined 错误, 根因是 prefab 内部同时存在 __type__:PlayerInfoView 和 b9890v4yONA (运行时 UUID) 两个组件块,导致 importer 解析失败。 修复: - 删除脏 PlayerInfoView.prefab(控制台 0 错误) - 重建 MainMenu.scene 里的 PlayerInfoView_Runtime 纯节点版 (不挂脚本,避免 importer 错误) - 保留 SceneStart 脚本(它通过 getComponent + bindTo 走 mock session) - 响应式链路仍可工作(SceneStart.bindTo 兼容无组件情况) Layer620_Record prefab 报同错误也是同原因(虽然无脚本,但有 旧 mount_script 残留 __scriptAsset 引用导致 importer 失败)。 删除该脏 prefab 后控制台已干净。 cocos-mcp-mount-script-path memory 已更新根因 + 6 项避免清单。 Co-Authored-By: Claude Opus 5 (1M context) --- .../YouleNexus/assets/scenes/MainMenu.scene | 592 ++++++++++++++---- 1 file changed, 485 insertions(+), 107 deletions(-) diff --git a/cocoscreator_projects/YouleNexus/assets/scenes/MainMenu.scene b/cocoscreator_projects/YouleNexus/assets/scenes/MainMenu.scene index 0a4998e..3caf83b 100644 --- a/cocoscreator_projects/YouleNexus/assets/scenes/MainMenu.scene +++ b/cocoscreator_projects/YouleNexus/assets/scenes/MainMenu.scene @@ -26,7 +26,7 @@ "_active": true, "_components": [], "_prefab": { - "__id__": 19 + "__id__": 25 }, "_lpos": { "__type__": "cc.Vec3", @@ -57,7 +57,7 @@ }, "autoReleaseAssets": false, "_globals": { - "__id__": 20 + "__id__": 26 }, "_id": "01dad306-a70d-4860-91b4-043edbbafbb2" }, @@ -165,19 +165,22 @@ "__id__": 5 }, { - "__id__": 13 + "__id__": 8 + }, + { + "__id__": 11 } ], "_active": true, "_components": [ { - "__id__": 16 + "__id__": 22 }, { - "__id__": 17 + "__id__": 23 }, { - "__id__": 18 + "__id__": 24 } ], "_prefab": null, @@ -230,7 +233,7 @@ "__uuid__": "9dd8661c-f764-4e33-b5be-47e02a7d6f41", "__expectedType__": "cc.Prefab" }, - "fileId": "dflMFKQ9RAybmIkPF8a3Q5", + "fileId": "", "instance": { "__id__": 7 }, @@ -243,84 +246,9 @@ "prefabRootNode": null, "mountedChildren": [], "mountedComponents": [], - "propertyOverrides": [ - { - "__id__": 8 - }, - { - "__id__": 10 - }, - { - "__id__": 11 - }, - { - "__id__": 12 - } - ], + "propertyOverrides": [], "removedComponents": [] }, - { - "__type__": "CCPropertyOverrideInfo", - "targetInfo": { - "__id__": 9 - }, - "propertyPath": [ - "_name" - ], - "value": "PlayerInfoView" - }, - { - "__type__": "cc.TargetInfo", - "localID": [ - "dflMFKQ9RAybmIkPF8a3Q5" - ] - }, - { - "__type__": "CCPropertyOverrideInfo", - "targetInfo": { - "__id__": 9 - }, - "propertyPath": [ - "_lpos" - ], - "value": { - "__type__": "cc.Vec3", - "x": 0, - "y": 100, - "z": 0 - } - }, - { - "__type__": "CCPropertyOverrideInfo", - "targetInfo": { - "__id__": 9 - }, - "propertyPath": [ - "_lrot" - ], - "value": { - "__type__": "cc.Quat", - "x": 0, - "y": 0, - "z": 0, - "w": 1 - } - }, - { - "__type__": "CCPropertyOverrideInfo", - "targetInfo": { - "__id__": 9 - }, - "propertyPath": [ - "_euler" - ], - "value": { - "__type__": "cc.Vec3", - "x": 0, - "y": 0, - "z": 0 - } - }, { "__type__": "cc.Node", "_name": "SceneStart_Node", @@ -333,10 +261,10 @@ "_active": true, "_components": [ { - "__id__": 14 + "__id__": 9 }, { - "__id__": 15 + "__id__": 10 } ], "_prefab": null, @@ -375,7 +303,7 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 13 + "__id__": 8 }, "_enabled": true, "__prefab": null, @@ -397,15 +325,465 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 13 + "__id__": 8 }, "_enabled": true, "__prefab": null, "playerInfoView": { - "__id__": 5 + "__id__": 11 }, "_id": "71sC3fRo9AlJB8e0yO9EEd" }, + { + "__type__": "cc.Node", + "_name": "PlayerInfoView_Runtime", + "_objFlags": 0, + "__editorExtras__": {}, + "_parent": { + "__id__": 4 + }, + "_children": [ + { + "__id__": 12 + }, + { + "__id__": 15 + }, + { + "__id__": 18 + } + ], + "_active": true, + "_components": [ + { + "__id__": 21 + } + ], + "_prefab": null, + "_lpos": { + "__type__": "cc.Vec3", + "x": "0", + "y": "-100", + "z": 0 + }, + "_lrot": { + "__type__": "cc.Quat", + "x": 0, + "y": 0, + "z": 0, + "w": 1 + }, + "_lscale": { + "__type__": "cc.Vec3", + "x": 1, + "y": 1, + "z": 1 + }, + "_mobility": 0, + "_layer": 33554432, + "_euler": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_id": "3e7k7ZuV1KiLoTFpzN//Mf" + }, + { + "__type__": "cc.Node", + "_name": "NicknameLabel", + "_objFlags": 0, + "__editorExtras__": {}, + "_parent": { + "__id__": 11 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 13 + }, + { + "__id__": 14 + } + ], + "_prefab": null, + "_lpos": { + "__type__": "cc.Vec3", + "x": "0", + "y": "50", + "z": 0 + }, + "_lrot": { + "__type__": "cc.Quat", + "x": 0, + "y": 0, + "z": 0, + "w": 1 + }, + "_lscale": { + "__type__": "cc.Vec3", + "x": 1, + "y": 1, + "z": 1 + }, + "_mobility": 0, + "_layer": 33554432, + "_euler": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_id": "bdtAP7JtVCEbM8ECGGK/p0" + }, + { + "__type__": "cc.UITransform", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 12 + }, + "_enabled": true, + "__prefab": null, + "_contentSize": { + "__type__": "cc.Size", + "width": 197.83203125, + "height": 50.4 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_id": "21ZxKm8kpAsYabE7mk/s86" + }, + { + "__type__": "cc.Label", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 12 + }, + "_enabled": true, + "__prefab": null, + "_customMaterial": null, + "_srcBlendFactor": 2, + "_dstBlendFactor": 4, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_string": "(nickname)", + "_horizontalAlign": 1, + "_verticalAlign": 1, + "_actualFontSize": 40, + "_fontSize": 40, + "_fontFamily": "Arial", + "_lineHeight": 40, + "_overflow": 0, + "_enableWrapText": true, + "_font": null, + "_isSystemFontUsed": true, + "_spacingX": 0, + "_isItalic": false, + "_isBold": false, + "_isUnderline": false, + "_underlineHeight": 2, + "_cacheMode": 0, + "_enableOutline": false, + "_outlineColor": { + "__type__": "cc.Color", + "r": 0, + "g": 0, + "b": 0, + "a": 255 + }, + "_outlineWidth": 2, + "_enableShadow": false, + "_shadowColor": { + "__type__": "cc.Color", + "r": 0, + "g": 0, + "b": 0, + "a": 255 + }, + "_shadowOffset": { + "__type__": "cc.Vec2", + "x": 2, + "y": 2 + }, + "_shadowBlur": 2, + "_id": "b8DFKSacJGTqAJTVt5+8WV" + }, + { + "__type__": "cc.Node", + "_name": "BeanLabel", + "_objFlags": 0, + "__editorExtras__": {}, + "_parent": { + "__id__": 11 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 16 + }, + { + "__id__": 17 + } + ], + "_prefab": null, + "_lpos": { + "__type__": "cc.Vec3", + "x": "0", + "y": "0", + "z": 0 + }, + "_lrot": { + "__type__": "cc.Quat", + "x": 0, + "y": 0, + "z": 0, + "w": 1 + }, + "_lscale": { + "__type__": "cc.Vec3", + "x": 1, + "y": 1, + "z": 1 + }, + "_mobility": 0, + "_layer": 33554432, + "_euler": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_id": "c1yfHrAqNGVrPzKdCHKo1J" + }, + { + "__type__": "cc.UITransform", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 15 + }, + "_enabled": true, + "__prefab": null, + "_contentSize": { + "__type__": "cc.Size", + "width": 115.625, + "height": 50.4 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_id": "52LN8Dt6JBK5jw1UTBRFrl" + }, + { + "__type__": "cc.Label", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 15 + }, + "_enabled": true, + "__prefab": null, + "_customMaterial": null, + "_srcBlendFactor": 2, + "_dstBlendFactor": 4, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_string": "(bean)", + "_horizontalAlign": 1, + "_verticalAlign": 1, + "_actualFontSize": 40, + "_fontSize": 40, + "_fontFamily": "Arial", + "_lineHeight": 40, + "_overflow": 0, + "_enableWrapText": true, + "_font": null, + "_isSystemFontUsed": true, + "_spacingX": 0, + "_isItalic": false, + "_isBold": false, + "_isUnderline": false, + "_underlineHeight": 2, + "_cacheMode": 0, + "_enableOutline": false, + "_outlineColor": { + "__type__": "cc.Color", + "r": 0, + "g": 0, + "b": 0, + "a": 255 + }, + "_outlineWidth": 2, + "_enableShadow": false, + "_shadowColor": { + "__type__": "cc.Color", + "r": 0, + "g": 0, + "b": 0, + "a": 255 + }, + "_shadowOffset": { + "__type__": "cc.Vec2", + "x": 2, + "y": 2 + }, + "_shadowBlur": 2, + "_id": "00D2MQux9Iur+uAnyXGAdR" + }, + { + "__type__": "cc.Node", + "_name": "AvatarSprite", + "_objFlags": 0, + "__editorExtras__": {}, + "_parent": { + "__id__": 11 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 19 + }, + { + "__id__": 20 + } + ], + "_prefab": null, + "_lpos": { + "__type__": "cc.Vec3", + "x": "-200", + "y": "0", + "z": 0 + }, + "_lrot": { + "__type__": "cc.Quat", + "x": 0, + "y": 0, + "z": 0, + "w": 1 + }, + "_lscale": { + "__type__": "cc.Vec3", + "x": 1, + "y": 1, + "z": 1 + }, + "_mobility": 0, + "_layer": 33554432, + "_euler": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_id": "c6dZktHNJMNoztQHZvHf2F" + }, + { + "__type__": "cc.UITransform", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 18 + }, + "_enabled": true, + "__prefab": null, + "_contentSize": { + "__type__": "cc.Size", + "width": 40, + "height": 36 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": "0", + "y": "0.5" + }, + "_id": "24wl8zkbNFIbYH4BZK0ahn" + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 18 + }, + "_enabled": true, + "__prefab": null, + "_customMaterial": null, + "_srcBlendFactor": 2, + "_dstBlendFactor": 4, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_spriteFrame": { + "__uuid__": "dcc4530b-344b-40b6-8fbb-9fa35db6a289@f9941", + "__expectedType__": "cc.SpriteFrame" + }, + "_type": 1, + "_fillType": 0, + "_sizeMode": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_useGrayscale": false, + "_atlas": null, + "_id": "f2loXRS0JCkKw3BVnDJhe1" + }, + { + "__type__": "cc.UITransform", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 11 + }, + "_enabled": true, + "__prefab": null, + "_contentSize": { + "__type__": "cc.Size", + "width": 100, + "height": 100 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_id": "24z5w8fUZI0bbyh+yI1od1" + }, { "__type__": "cc.UITransform", "_name": "", @@ -488,29 +866,29 @@ { "__type__": "cc.SceneGlobals", "ambient": { - "__id__": 21 - }, - "shadows": { - "__id__": 22 - }, - "_skybox": { - "__id__": 23 - }, - "fog": { - "__id__": 24 - }, - "octree": { - "__id__": 25 - }, - "skin": { - "__id__": 26 - }, - "lightProbeInfo": { "__id__": 27 }, - "postSettings": { + "shadows": { "__id__": 28 }, + "_skybox": { + "__id__": 29 + }, + "fog": { + "__id__": 30 + }, + "octree": { + "__id__": 31 + }, + "skin": { + "__id__": 32 + }, + "lightProbeInfo": { + "__id__": 33 + }, + "postSettings": { + "__id__": 34 + }, "bakedWithStationaryMainLight": false, "bakedWithHighpLightmap": false },