Commit 1472461c authored by limingzhe's avatar limingzhe

fix: 闪屏异常

parent def498c0
......@@ -77,6 +77,7 @@ cc.Class({
getData = window.courseware.getData;
}
getData((data) => {
this.data = data || this.getDefaultData();
this.data = JSON.parse(JSON.stringify(this.data))
......@@ -90,8 +91,20 @@ cc.Class({
cc.audioEngine.stopAll()
},
getData(cb) {
cb(this.getDefaultData());
getData(func) {
if (window && window.courseware) {
window.courseware.getData(func, 'scene');
return;
}
const middleLayer = cc.find('middleLayer');
if (middleLayer) {
const middleLayerComponent = middleLayer.getComponent('middleLayer');
middleLayerComponent.getData(func);
return;
}
func(this.getDefaultData());
},
getDefaultData() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment