Commit 95074d48 authored by zjz1994's avatar zjz1994

性能优化暂存

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