Commit 95074d48 authored by zjz1994's avatar zjz1994

性能优化暂存

parent 8bfe8d17
......@@ -188,7 +188,7 @@ export default class MainBase extends eui.UILayer {
panels.forEach(item => PanelCtrl.instance.registerPanel(item[0], item[1]));
scenes.forEach(item => SceneCtrl.instance.registerScene(item[0], item[1]));
console.log("sceneCtrl所有的场景",SceneCtrl.instance._sceneClassMap);
// console.log("sceneCtrl所有的场景",SceneCtrl.instance._sceneClassMap);
// NetManager.ins.onNotSuccess = (msg) => {
// s
// }
......
......@@ -381,7 +381,6 @@ export default class MainScene extends Scene {
//初始换道具容器
this.propBtnCon = new PropBtnCon();
this.addChild(this.propBtnCon);
console.log("添加道具group",this.propBtnCon);
this.mapContainer = new egret.DisplayObjectContainer();
this.addChild(this.mapContainer);
......@@ -417,9 +416,7 @@ export default class MainScene extends Scene {
this.bonusTime.y = 600;
}
async start(data) {
super.start();
resetMainScene(){
this.emptys = new Array();
this.warningCop = new Array();
this.eliminatedElements = new Array();
......@@ -430,6 +427,17 @@ export default class MainScene extends Scene {
this.cannoEffect = new Array();
this.readyCannoArr = new Array();
this.fireteamCannoArr = new Array();
this.passElements = new Array();
this.noActionCount = 0;
this.isShowWarning = false;
this.magicRotateData = new Array();
this.commonContinuityTimes = 0;
this.effectContinuityTimes = 0;
this.lollipopCount = 0;
this.hasPassed = false;
this.isCountingTime = false;
this.mapContainer.removeChildren();
this.mapupContainer.removeChildren();
......@@ -437,8 +445,12 @@ export default class MainScene extends Scene {
this.effectContainer.removeChildren();
this.guideContainer.removeChildren();
this.festivalContainer.removeChildren();
}
async start(data) {
super.start();
this.resetMainScene();
console.log("mainscene---------start",data,data.chapter);
// window['gm'] = this.gm;
//第几关
......
......@@ -86,6 +86,7 @@ export class Element extends eui.Component {
}
fire(type: ElementType) {// zi hong huang lan lv
console.log("烟花绽放");
this._fireworksTimer = new Date().getTime();
if (type == ElementType.FIREWORKS_RABBIT) //rabbit 紫
this.toFireworksAction(1, 90);
......@@ -110,10 +111,10 @@ export class Element extends eui.Component {
this._fireworks = mv;
mv.anchorOffsetX = 340 / 2;
mv.anchorOffsetY = 500;
mv.x = this.x;
mv.y = this.y - 38;
}
this._fireworks.x = this.x;
this._fireworks.y = this.y - 38;
thisobj.addChild(this._fireworks);
this._fireworks.gotoAndStop(1);
......@@ -122,10 +123,10 @@ export class Element extends eui.Component {
const cb = () => {
if (this._fireworks.currentFrame == end) { //向上吹
this._fireworks.gotoAndStop(start);
// this._fireworks.removeEventListener(egret.Event.ENTER_FRAME, cb, this);
this._fireworks.removeEventListener(egret.Event.ENTER_FRAME, cb, this);
}
};
this._fireworks.once(egret.Event.ENTER_FRAME, cb, this);
this._fireworks.addEventListener(egret.Event.ENTER_FRAME, cb, this);
this._fireworks.gotoAndPlay(start, true);
}
......
......@@ -54,7 +54,7 @@ export default class StartScene extends Scene {
setGlow(this['percentTxt'], 0xffffff, 1);
console.log(data);
// console.log(data);
if (data && Array.isArray(data)) {
this['container3'].addChild(data[0]);
this['container2'].addChild(data[1]);
......
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