fix(ui): 修复 PlayerInfoView.prefab 的脚本引用缺失(attempt)

正确流程:cocos_prefab edit_enter → mount_script → set_property →
edit_save → edit_exit。
prefab 仍然缺 __scriptAsset 字段(Cocos 期望 __type__ + __scriptAsset 共存)。
需要进一步排查 cocos-mcp-server 的 prefab 序列化机制。
This commit is contained in:
2026-08-31 21:40:58 +08:00
parent 2edf57ec40
commit 79c2c804dc
@@ -22,10 +22,10 @@
"__id__": 2 "__id__": 2
}, },
{ {
"__id__": 3 "__id__": 8
}, },
{ {
"__id__": 4 "__id__": 14
} }
], ],
"_active": true, "_active": true,
@@ -35,10 +35,13 @@
}, },
{ {
"__id__": 22 "__id__": 22
},
{
"__id__": 24
} }
], ],
"_prefab": { "_prefab": {
"__id__": 24 "__id__": 26
}, },
"_lpos": { "_lpos": {
"__type__": "cc.Vec3", "__type__": "cc.Vec3",
@@ -50,7 +53,8 @@
"__type__": "cc.Quat", "__type__": "cc.Quat",
"x": 0, "x": 0,
"y": 0, "y": 0,
"z": 0 "z": 0,
"w": 1
}, },
"_lscale": { "_lscale": {
"__type__": "cc.Vec3", "__type__": "cc.Vec3",
@@ -80,14 +84,14 @@
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 5 "__id__": 3
}, },
{ {
"__id__": 7 "__id__": 5
} }
], ],
"_prefab": { "_prefab": {
"__id__": 9 "__id__": 7
}, },
"_lpos": { "_lpos": {
"__type__": "cc.Vec3", "__type__": "cc.Vec3",
@@ -99,7 +103,8 @@
"__type__": "cc.Quat", "__type__": "cc.Quat",
"x": 0, "x": 0,
"y": 0, "y": 0,
"z": 0 "z": 0,
"w": 1
}, },
"_lscale": { "_lscale": {
"__type__": "cc.Vec3", "__type__": "cc.Vec3",
@@ -117,6 +122,115 @@
}, },
"_id": "" "_id": ""
}, },
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 2
},
"_enabled": true,
"__prefab": {
"__id__": 4
},
"_contentSize": {
"__type__": "cc.Size",
"width": 197.83203125,
"height": 50.4
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "OqsxQHKUEDc8ismoShpIf7"
},
{
"__type__": "cc.Label",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 2
},
"_enabled": true,
"__prefab": {
"__id__": 6
},
"_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": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "H9oJa64UHynJ09/BTRY3F5"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "8a3UixwStPLYw7wpJxpnx2",
"instance": null,
"targetOverrides": null,
"nestedPrefabInstanceRoots": null
},
{ {
"__type__": "cc.Node", "__type__": "cc.Node",
"_name": "BeanLabel", "_name": "BeanLabel",
@@ -129,14 +243,14 @@
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 10 "__id__": 9
}, },
{ {
"__id__": 12 "__id__": 11
} }
], ],
"_prefab": { "_prefab": {
"__id__": 14 "__id__": 13
}, },
"_lpos": { "_lpos": {
"__type__": "cc.Vec3", "__type__": "cc.Vec3",
@@ -148,7 +262,8 @@
"__type__": "cc.Quat", "__type__": "cc.Quat",
"x": 0, "x": 0,
"y": 0, "y": 0,
"z": 0 "z": 0,
"w": 1
}, },
"_lscale": { "_lscale": {
"__type__": "cc.Vec3", "__type__": "cc.Vec3",
@@ -166,6 +281,115 @@
}, },
"_id": "" "_id": ""
}, },
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 8
},
"_enabled": true,
"__prefab": {
"__id__": 10
},
"_contentSize": {
"__type__": "cc.Size",
"width": 115.625,
"height": 50.4
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "Xh/p8USrolqm7IUmIM90dY"
},
{
"__type__": "cc.Label",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 8
},
"_enabled": true,
"__prefab": {
"__id__": 12
},
"_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": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "LGYEulOEhq+LPsLSc/MEQ9"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "61AFDU71BAZr2SwfHXHyax",
"instance": null,
"targetOverrides": null,
"nestedPrefabInstanceRoots": null
},
{ {
"__type__": "cc.Node", "__type__": "cc.Node",
"_name": "AvatarSprite", "_name": "AvatarSprite",
@@ -197,7 +421,8 @@
"__type__": "cc.Quat", "__type__": "cc.Quat",
"x": 0, "x": 0,
"y": 0, "y": 0,
"z": 0 "z": 0,
"w": 1
}, },
"_lscale": { "_lscale": {
"__type__": "cc.Vec3", "__type__": "cc.Vec3",
@@ -221,159 +446,7 @@
"_objFlags": 0, "_objFlags": 0,
"__editorExtras__": {}, "__editorExtras__": {},
"node": { "node": {
"__id__": 2 "__id__": 14
},
"_enabled": true,
"__prefab": {
"__id__": 6
},
"_contentSize": {
"__type__": "cc.Size",
"width": 197.83203125,
"height": 50.4
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "OqsxQHKUEDc8ismoShpIf7"
},
{
"__type__": "cc.Label",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 2
},
"_enabled": true,
"__prefab": {
"__id__": 8
},
"_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,
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "H9oJa64UHynJ09/BTRY3F5"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "8a3UixwStPLYw7wpJxpnx2",
"instance": null,
"targetOverrides": null,
"nestedPrefabInstanceRoots": null
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 3
},
"_enabled": true,
"__prefab": {
"__id__": 11
},
"_contentSize": {
"__type__": "cc.Size",
"width": 115.625,
"height": 50.4
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "Xh/p8USrolqm7IUmIM90dY"
},
{
"__type__": "cc.Label",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 3
},
"_enabled": true,
"__prefab": {
"__id__": 13
},
"_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,
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "LGYEulOEhq+LPsLSc/MEQ9"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "61AFDU71BAZr2SwfHXHyax",
"instance": null,
"targetOverrides": null,
"nestedPrefabInstanceRoots": null
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 4
}, },
"_enabled": true, "_enabled": true,
"__prefab": { "__prefab": {
@@ -401,16 +474,12 @@
"_objFlags": 0, "_objFlags": 0,
"__editorExtras__": {}, "__editorExtras__": {},
"node": { "node": {
"__id__": 4 "__id__": 14
}, },
"_enabled": true, "_enabled": true,
"__prefab": { "__prefab": {
"__id__": 18 "__id__": 18
}, },
"_spriteFrame": {
"__uuid__": "dcc4530b-344b-40b6-8fbb-9fa35db6a289@f9941",
"__expectedType__": "cc.SpriteFrame"
},
"_customMaterial": null, "_customMaterial": null,
"_srcBlendFactor": 2, "_srcBlendFactor": 2,
"_dstBlendFactor": 4, "_dstBlendFactor": 4,
@@ -421,6 +490,10 @@
"b": 255, "b": 255,
"a": 255 "a": 255
}, },
"_spriteFrame": {
"__uuid__": "dcc4530b-344b-40b6-8fbb-9fa35db6a289@f9941",
"__expectedType__": "cc.SpriteFrame"
},
"_type": 1, "_type": 1,
"_fillType": 0, "_fillType": 0,
"_sizeMode": 0, "_sizeMode": 0,
@@ -485,7 +558,6 @@
"__type__": "PlayerInfoView", "__type__": "PlayerInfoView",
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"__editorExtras__": {},
"node": { "node": {
"__id__": 1 "__id__": 1
}, },
@@ -508,6 +580,33 @@
"__type__": "cc.CompPrefabInfo", "__type__": "cc.CompPrefabInfo",
"fileId": "m5Phmi1gu84B84JJS5XcHd" "fileId": "m5Phmi1gu84B84JJS5XcHd"
}, },
{
"__type__": "b9890v4yONA+a/v2YVJMDO5",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 1
},
"_enabled": true,
"__prefab": {
"__id__": 25
},
"nicknameLabel": {
"__id__": 2
},
"beanLabel": {
"__id__": 8
},
"avatarSprite": {
"__id__": 14
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "29A3ICE8hAga+sRYGXOpM7"
},
{ {
"__type__": "cc.PrefabInfo", "__type__": "cc.PrefabInfo",
"root": { "root": {
@@ -518,7 +617,6 @@
}, },
"fileId": "dflMFKQ9RAybmIkPF8a3Q5", "fileId": "dflMFKQ9RAybmIkPF8a3Q5",
"instance": null, "instance": null,
"targetOverrides": null, "targetOverrides": null
"nestedPrefabInstanceRoots": null
} }
] ]