Commit 8bc4d5d6 authored by liujiangnan's avatar liujiangnan

feat

parent 4f4ed69a
...@@ -57,7 +57,7 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -57,7 +57,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
this.rootAttrTree = this.getComponent('Attributes'); this.rootAttrTree = this.getComponent('Attributes');
this.initBg(); this.initBg();
this.initUnitViewPager(); this.initUnitViewPager();
await this.createFiniteStateMachines(); this.createFiniteStateMachines();
const BackViewButtons = this.rootAttrTree.querySelectorAll('.back-view'); const BackViewButtons = this.rootAttrTree.querySelectorAll('.back-view');
BackViewButtons.forEach(b => { BackViewButtons.forEach(b => {
buttonOnClick(b, ()=> { buttonOnClick(b, ()=> {
...@@ -227,7 +227,7 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -227,7 +227,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
cc.audioEngine.playMusic(audio, true); cc.audioEngine.playMusic(audio, true);
} }
createFiniteStateMachines() { createFiniteStateMachines() {
return new Promise((resolve) => {
let pid = 21228; // 本地测试用 let pid = 21228; // 本地测试用
let pname = 'level 1'; // 本地测试用 let pname = 'level 1'; // 本地测试用
const middleLayer = cc.find('middleLayer'); const middleLayer = cc.find('middleLayer');
...@@ -375,7 +375,10 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -375,7 +375,10 @@ export default class SceneComponent extends MyCocosSceneComponent {
ctx.UnitViewData = list; ctx.UnitViewData = list;
ctx.currentDataset = list; ctx.currentDataset = list;
} }
resolve();
if (window && window["air"]) {
window["air"].hideAirClassLoading();
}
}); });
}, },
...@@ -396,8 +399,6 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -396,8 +399,6 @@ export default class SceneComponent extends MyCocosSceneComponent {
console.log(1, state); console.log(1, state);
}); });
});
} }
setStateContextData({ rows, buttonsKey }) { setStateContextData({ rows, buttonsKey }) {
const buttons = buttonsKey; const buttons = buttonsKey;
......
...@@ -89,17 +89,7 @@ export class MyCocosSceneComponent extends cc.Component { ...@@ -89,17 +89,7 @@ export class MyCocosSceneComponent extends cc.Component {
const preloadArr = this._imageResList.concat(this._audioResList).concat(this._animaResList); const preloadArr = this._imageResList.concat(this._audioResList).concat(this._animaResList);
cc.assetManager.loadAny(preloadArr, null, null, async (err, data) => { cc.assetManager.loadAny(preloadArr, null, null, async (err, data) => {
if (window && window["air"]) {
// window["air"].onCourseInScreen = (next) => {
// window["air"].isCourseInScreen = true;
// this.onLoadEnd();
// next();
// };
await this.onLoadEnd();
window["air"].hideAirClassLoading();
} else {
this.onLoadEnd(); this.onLoadEnd();
}
cc.debug.setDisplayStats(false); cc.debug.setDisplayStats(false);
}); });
......
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