是要修改从 Max/Maya 导出的配置,使用相对路径,导入到项目中保持一样的相对路径关系
谢谢解答,试试先,还有些疑惑的是为什么有些电脑上是相对位置,有些确实绝对位置呢?
在原始导出的电脑上,是绝对路径,因为导入器可以通过绝对路径找到资源,但是到别人电脑上,自然绝对路径失效了,我们会自动在文件附近寻找引用的资源,如果找到了,会通过 uuid 来索引。你看到的差异就是uuid引用和绝对路径引用的冲突
3.x 系列最低支持Android打包到多少版本? 4.4.x 的老机器?2.x 是可以的。
cocos creator 打包Android 发布原生平台 简直就是灾难级的,能否不完整编译,机器废命且耗时,可否集成免引擎编译,直接发布,避免自己改项目文件支持。编译构建实在太难用了,另外优化一下安卓掌机手柄的支持,越来越多人用手柄玩游戏了。
post-process-builder里面从misc里面引用的cameracomponent打个包就会报错。cameracomponent is not exported
把prefabA拖动到prefabB里,大概率报错。
prefabA的节点名字会自动变成“New Node”,然后控制台报错:
[Scene] Node New Node(90mHOevTJAY5ydR9S/J1ih) has not attached to a scene.
Error: [Scene] Node New Node(90mHOevTJAY5ydR9S/J1ih) has not attached to a scene.
at error (/Applications/CocosCreator/Creator/3.8.0_community/CocosCreator.app/Contents/Resources/resources/3d/engine/bin/.cache/dev/editor/bundled/index.js:174421:12)
at Node._updateScene (/Applications/CocosCreator/Creator/3.8.0_community/CocosCreator.app/Contents/Resources/resources/3d/engine/bin/.cache/dev/editor/bundled/index.js:56396:13)
at _setScene (/Applications/CocosCreator/Creator/3.8.0_community/CocosCreator.app/Contents/Resources/resources/3d/engine/bin/.cache/dev/editor/bundled/index.js:56266:16)
at Scene.walk (/Applications/CocosCreator/Creator/3.8.0_community/CocosCreator.app/Contents/Resources/resources/3d/engine/bin/.cache/dev/editor/bundled/index.js:56721:15)
at Scene._load (/Applications/CocosCreator/Creator/3.8.0_community/CocosCreator.app/Contents/Resources/resources/3d/engine/bin/.cache/dev/editor/bundled/index.js:62641:16)
at Director.runSceneImmediate (/Applications/CocosCreator/Creator/3.8.0_community/CocosCreator.app/Contents/Resources/resources/3d/engine/bin/.cache/dev/editor/bundled/index.js:15909:17)
at /Applications/CocosCreator/Creator/3.8.0_community/CocosCreator.app/Contents/Resources/app.asar/builtin/scene/dist/script/3d/manager/scene/utils.ccc:1:1113
此后prefabB的数据就永久损坏了,无论是清缓存还是重启,点开prefabB就会报错,且每次括号里的id(90mHOevTJAY5ydR9S/J1ih)都不一样。
这种情况下打开prefabC,会报警告(警告里还多了个花括号):
[Scene] Node(New Node}) is invalid or its data is corrupted.
Error: [Scene] Node(New Node}) is invalid or its data is corrupted.
at Node.eval [as _registerIfAttached] (/Applications/CocosCreator/Creator/3.8.0_community/CocosCreator.app/Contents/Resources/resources/3d/engine/bin/.cache/dev/editor/bundled/index.js:54905:19)
at Node.eval [as _registerIfAttached] (/Applications/CocosCreator/Creator/3.8.0_community/CocosCreator.app/Contents/Resources/resources/3d/engine/bin/.cache/dev/editor/bundled/index.js:54942:17)
at Node.eval [as _registerIfAttached] (/Applications/CocosCreator/Creator/3.8.0_community/CocosCreator.app/Contents/Resources/resources/3d/engine/bin/.cache/dev/editor/bundled/index.js:54942:17)
at Node.eval [as _registerIfAttached] (/Applications/CocosCreator/Creator/3.8.0_community/CocosCreator.app/Contents/Resources/resources/3d/engine/bin/.cache/dev/editor/bundled/index.js:54942:17)
at Scene.eval [as _registerIfAttached] (/Applications/CocosCreator/Creator/3.8.0_community/CocosCreator.app/Contents/Resources/resources/3d/engine/bin/.cache/dev/editor/bundled/index.js:54942:17)
at Scene._onPreDestroyBase (/Applications/CocosCreator/Creator/3.8.0_community/CocosCreator.app/Contents/Resources/resources/3d/engine/bin/.cache/dev/editor/bundled/index.js:57387:18)
at Scene.eval (/Applications/CocosCreator/Creator/3.8.0_community/CocosCreator.app/Contents/Resources/resources/3d/engine/bin/.cache/dev/editor/bundled/index.js:54772:38)
纯2D项目,没有用到3D的任何功能
预制体资源可以发我看一下吗
[
{
"__type__": "cc.Prefab",
"_name": "garden-item",
"_objFlags": 0,
"__editorExtras__": {},
"_native": "",
"data": {
"__id__": 1
},
"optimizationPolicy": 0,
"persistent": false
},
{
"__type__": "cc.Node",
"_name": "garden-item",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": null,
"_children": [
{
"__id__": 2
},
{
"__id__": 8
},
{
"__id__": 14
}
],
"_active": true,
"_components": [
{
"__id__": 24
}
],
"_prefab": {
"__id__": 26
},
"_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": ""
},
{
"__type__": "cc.Node",
"_name": "bg",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": {
"__id__": 1
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 3
},
{
"__id__": 5
}
],
"_prefab": {
"__id__": 7
},
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": 300,
"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": ""
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 2
},
"_enabled": true,
"__prefab": {
"__id__": 4
},
"_contentSize": {
"__type__": "cc.Size",
"width": 750,
"height": 600
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 1
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "b4plO30jNGaqZ5DCGk8Zya"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 2
},
"_enabled": true,
"__prefab": {
"__id__": 6
},
"_customMaterial": null,
"_srcBlendFactor": 2,
"_dstBlendFactor": 4,
"_color": {
"__type__": "cc.Color",
"r": 97,
"g": 131,
"b": 100,
"a": 255
},
"_spriteFrame": {
"__uuid__": "7d8f9b89-4fd1-4c9f-a3ab-38ec7cded7ca@f9941",
"__expectedType__": "cc.SpriteFrame"
},
"_type": 0,
"_fillType": 0,
"_sizeMode": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_useGrayscale": false,
"_atlas": null,
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "55ipNvC/BK4ojPHvvOe02Y"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "32JhYqcTlD1L1YKahXNGwG",
"instance": null,
"targetOverrides": null,
"nestedPrefabInstanceRoots": null
},
{
"__type__": "cc.Node",
"_name": "ui_layer",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": {
"__id__": 1
},
"_children": [
{
"__id__": 9
}
],
"_active": true,
"_components": [
{
"__id__": 11
}
],
"_prefab": {
"__id__": 13
},
"_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": ""
},
{
"__type__": "cc.Node",
"_name": "New Node",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": null,
"_children": [],
"_active": true,
"_components": [],
"_prefab": {
"__id__": 10
},
"_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": 1073741824,
"_euler": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_id": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "e0CXw/OrRG/oNm7v5dE9zU",
"instance": null,
"targetOverrides": null,
"nestedPrefabInstanceRoots": null
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 8
},
"_enabled": true,
"__prefab": {
"__id__": 12
},
"_contentSize": {
"__type__": "cc.Size",
"width": 100,
"height": 100
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "65sqVGKhtD4o+7VBtcGsC4"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "e5AQTB7pZPX5GV8ySKzc3m",
"instance": null,
"targetOverrides": null,
"nestedPrefabInstanceRoots": null
},
{
"__type__": "cc.Node",
"_name": "modal",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": {
"__id__": 1
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 15
},
{
"__id__": 17
},
{
"__id__": 19
},
{
"__id__": 21
}
],
"_prefab": {
"__id__": 23
},
"_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": ""
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 14
},
"_enabled": true,
"__prefab": {
"__id__": 16
},
"_contentSize": {
"__type__": "cc.Size",
"width": 750,
"height": 600
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "64VgkA1MNHM7mBOpnLbhOM"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 14
},
"_enabled": true,
"__prefab": {
"__id__": 18
},
"_alignFlags": 45,
"_target": null,
"_left": 0,
"_right": 0,
"_top": 0,
"_bottom": 0,
"_horizontalCenter": 0,
"_verticalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 100,
"_originalHeight": 100,
"_alignMode": 2,
"_lockFlags": 45,
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "725OVNRs5F7LqZqfLPj1JP"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 14
},
"_enabled": true,
"__prefab": {
"__id__": 20
},
"_customMaterial": null,
"_srcBlendFactor": 2,
"_dstBlendFactor": 4,
"_color": {
"__type__": "cc.Color",
"r": 0,
"g": 0,
"b": 0,
"a": 90
},
"_spriteFrame": {
"__uuid__": "7d8f9b89-4fd1-4c9f-a3ab-38ec7cded7ca@f9941",
"__expectedType__": "cc.SpriteFrame"
},
"_type": 0,
"_fillType": 0,
"_sizeMode": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_useGrayscale": false,
"_atlas": null,
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "c7+fc5AoNGaKzXQxcNTcXq"
},
{
"__type__": "cc.Button",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 14
},
"_enabled": true,
"__prefab": {
"__id__": 22
},
"clickEvents": [],
"_interactable": true,
"_transition": 0,
"_normalColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_hoverColor": {
"__type__": "cc.Color",
"r": 211,
"g": 211,
"b": 211,
"a": 255
},
"_pressedColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_disabledColor": {
"__type__": "cc.Color",
"r": 124,
"g": 124,
"b": 124,
"a": 255
},
"_normalSprite": {
"__uuid__": "7d8f9b89-4fd1-4c9f-a3ab-38ec7cded7ca@f9941",
"__expectedType__": "cc.SpriteFrame"
},
"_hoverSprite": null,
"_pressedSprite": null,
"_disabledSprite": null,
"_duration": 0.1,
"_zoomScale": 1.2,
"_target": null,
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "fa9ivxnipKVJGIk8ZbwSNx"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "ffs6DvuB9OI62oMFWGqTq9",
"instance": null,
"targetOverrides": null,
"nestedPrefabInstanceRoots": null
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 1
},
"_enabled": true,
"__prefab": {
"__id__": 25
},
"_contentSize": {
"__type__": "cc.Size",
"width": 750,
"height": 600
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "ebdnMOGClA47kmETk4LAKG"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "8eBVcQBCdBzZhvKH+RsAkl",
"instance": null,
"targetOverrides": null
}
]
看了下,这个数据确实损坏了,请问有复现出问题的预制体A和B的原始文件吗?如果有的话,在资源面板中,选中这两个资源,右键->导出资源包;发给我看能否复现

如果你需要修复数据,按照截图修改你发出来的数据,可以正常打开。但为何导致这个错误数据的产生,可能需要你提供的资源帮助我们更好复现问题
感谢你的配合,我把这个文件里损坏的修复后,重新拖入card预制体到ui_layer下,尝试了很多次都没有遇到你说的报错。我使用的版本是3.8社区版0621日期版本的。
请问下出现问题时,有什么其它的操作吗?比如外部修改了预制体文件或者通过git等工具更新了相关文件?我会接着尝试,看能否复现你说的报错。
我的操作大概是这样的:card拖进去以后保存,然后又修改了garden中的节点的属性,例如大小位置等,再保存时就报这个错了。没有使用git等其他工具,只用了编辑器3.8.0 mac0621
球面光的shadow有计划在哪个版本搞吗
谢谢!!!
