调整目录结构之后,出了点问题。

Can not find cc.Component in the script 1959d4TjU1Ct7kwpUqofGcC.
at Object.addComponent (D:\Application\cocosCreaor\appinfo\CocosCreator\resources\app.asar\editor\page\scene-utils\index.js:1:11457)
at editor-scene.scene:add-component (file:///D:/Application/cocosCreaor/appinfo/CocosCreator/resources/app.asar/editor/builtin/scene/panel/scene.js:1:8863)
at Object.Panel._dispatch (D:\Application\cocosCreaor\appinfo\CocosCreator\resources\app.asar\editor-framework\lib\renderer\panel.js:1:2294)
at EventEmitter. (D:\Application\cocosCreaor\appinfo\CocosCreator\resources\app.asar\editor-framework\lib\renderer\ipc.js:1:5098)
at emitMany (events.js:127:13)
at EventEmitter.emit (events.js:201:7)

Script attached to “gameLable” is missing or invalid. Detailed information:
Script attached to “gameLable” is missing or invalid. Detailed information:
Script attached to “gameLable” is missing or invalid. Detailed information:
Script attached to “gameLable” is missing or invalid. Detailed information:
Script attached to “createGameLayer” is missing or invalid. Detailed information:
Script attached to “gameListItemCell” is missing or invalid. Detailed information:
4
Script attached to “gameListLayer” is missing or invalid. Detailed information:
Script attached to “createClubLayer” is missing or invalid. Detailed information:
Script attached to “gameLayer” is missing or invalid. Detailed information:
Script attached to “scoreLayer” is missing or invalid. Detailed information:
Script attached to “item” is missing or invalid. Detailed information:
Script attached to “anysisLayer” is missing or invalid. Detailed information:
Script attached to “meLayer” is missing or invalid. Detailed information:
Script attached to “gameLable” in scene “home.fire” is missing or invalid. Detailed information:

出了一堆警告,项目还无法运行。Script 脚本也无法添加。怎么修复?

看看前面报了什么错?没错的话就按 F7 试试

Can not find cc.Component in the script 1959d4TjU1Ct7kwpUqofGcC.
修改了一些文件名,使得Script和组件关联不起来。很危险的操作,后来一点点的弄,全给手动绑定回去了。
能说一下F7什么作用么?
(ps:修改文件名之后,会造成部分组件和文件失去关联,不够智能)

修改文件名不会失去关联,应该是修改文件名,导致脚本里的 require 失效了,这时脚本无法编译通过引起的那个报错。
F7 的作用是强制重新编译一次。

ok,多谢