Commit b20cd983 authored by huoshizhe's avatar huoshizhe

feat: getData

parent 3ff863a6
...@@ -87,8 +87,20 @@ cc.Class({ ...@@ -87,8 +87,20 @@ cc.Class({
this.gameLogic.destroy(); this.gameLogic.destroy();
}, },
getData(cb) { getData(func) {
cb(this.getDefaultData()); 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() { 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