游戏运行时有类似这样的提示:
CCDebug.js:249 Failed to construct a dummy instance of the “RoomListScene2” class using new behind the scenes. This is for getting default values declared in TypeScript. Please ensure the class will be able to construct during script’s initialization. TypeError: Cannot read property ‘32’ of undefined.
26.cc.warnID @ CCDebug.js:249
extractActualDefaultValues @ CCClassDecorator.js:142
genProperty @ CCClassDecorator.js:204
normalized @ CCClassDecorator.js:429
299.window.__decorate @ typescript.js:26
(anonymous) @ RoomListScene2.ts:18
__define @ RoomListScene2.ts:112
(anonymous) @ RoomListScene2.ts:15
run @ modular.js:85
(anonymous) @ boot.js:315
_prepareFinished @ CCGame.js:387
(anonymous) @ CCGame.js:470
(anonymous) @ CCLoader.js:274
(anonymous) @ utils.js:80
setTimeout (async)
callInNextTick @ utils.js:79
(anonymous) @ CCLoader.js:267
119.proto.allComplete @ loading-items.js:528
119.proto.itemComplete @ loading-items.js:716
119.LoadingItems.itemComplete @ loading-items.js:379
122.proto.flowOut @ pipeline.js:319
flow @ pipeline.js:87
(anonymous) @ pipeline.js:64
(anonymous) @ downloader.js:260
loadHandler @ downloader.js:58
load (async)
downloadScript @ downloader.js:66
115.Downloader.handle @ downloader.js:257
115.Downloader._handleLoadQueue @ downloader.js:239
(anonymous) @ downloader.js:259
loadHandler @ downloader.js:58
load (async)
downloadScript @ downloader.js:66
115.Downloader.handle @ downloader.js:257
115.Downloader._handleLoadQueue @ downloader.js:239
(anonymous) @ downloader.js:259
loadHandler @ downloader.js:58
load (async)
downloadScript @ downloader.js:66
115.Downloader.handle @ downloader.js:257
flow @ pipeline.js:51
flow @ pipeline.js:84
122.proto.flowIn @ pipeline.js:275
119.proto.append @ loading-items.js:508
109.proto.load @ CCLoader.js:290
prepare @ CCGame.js:468
run @ CCGame.js:488
onload @ boot.js:314
window.onload @ boot.js:176
load (async)
(anonymous) @ boot.js:171
(anonymous) @ boot.js:401
CCDebug.js:249 Please specifiy a default value for “RoomListScene2” property at its declaration:
// Before:
@property(…)
value;
// After:
@property(…)
value = 0 labelPeach
。。
但运行没问题。
但是在编辑器中打开这个场景会失败,错误也是说 annot read property ‘32’ of undefined.
然后我手动打开fire文件,把32号这个component删掉了。删除library目录,重启creator,还是这个问题。
怎么破。。
我看了git记录,这个场景近期没有任何改动。
2.0.5