Commit 251bce34 authored by zjz1994's avatar zjz1994

优化暂存

parent 9ce49c8a
...@@ -28,7 +28,7 @@ export default class ComponentBase extends eui.Component { ...@@ -28,7 +28,7 @@ export default class ComponentBase extends eui.Component {
protected onSkinComplete() { protected onSkinComplete() {
} }
destroy() { destroy() {
this.removeEvents(); this.removeEvents();
} }
......
...@@ -26,6 +26,7 @@ export default class SceneCtrl { ...@@ -26,6 +26,7 @@ export default class SceneCtrl {
} }
change(type: ModuleTypes, data?, onComplete?: Function) { change(type: ModuleTypes, data?, onComplete?: Function) {
// console.log("sceneCtrl------change",type,data,onComplete);
if(type==ModuleTypes.MAIN_SCENE){//游戏页 if(type==ModuleTypes.MAIN_SCENE){//游戏页
// console.log("游戏界面单例处理"); // console.log("游戏界面单例处理");
if(this.mainscene){ if(this.mainscene){
...@@ -47,25 +48,25 @@ export default class SceneCtrl { ...@@ -47,25 +48,25 @@ export default class SceneCtrl {
} }
} }
} }
// else if(type==ModuleTypes.MAP_SCENE){//mapscene else if(type==ModuleTypes.MAP_SCENE){//mapscene
// if(this.mapscene){ if(this.mapscene){
// console.log("单例mapscene"); // console.log("单例mapscene");
// this.showAfterLoadAtlas(this.mapscene,data,onComplete); this.showAfterLoadAtlas(this.mapscene,data,onComplete);
// }else{ }else{
// console.log("新建mapscene"); // console.log("新建mapscene");
// this.mapscene = new MapScene(); this.mapscene = new MapScene(data);
// if (!window['development']) { if (!window['development']) {
// const promise = Promise.all([ const promise = Promise.all([
// RES.getResAsync(`${'Map'}_json`), RES.getResAsync(`${'Map'}_json`),
// RES.getResAsync(`${'Map'}_png`)]); RES.getResAsync(`${'Map'}_png`)]);
// promise.then(() => { promise.then(() => {
// this.showAfterLoadAtlas(this.mapscene, data, onComplete); this.showAfterLoadAtlas(this.mapscene, data, onComplete);
// }); });
// } else { } else {
// this.showAfterLoadAtlas(this.mapscene, data, onComplete); this.showAfterLoadAtlas(this.mapscene, data, onComplete);
// } }
// } }
// } }
else{ else{
const cls = this._sceneClassMap[type]; const cls = this._sceneClassMap[type];
const scene: Scene = new cls(); const scene: Scene = new cls();
......
...@@ -355,7 +355,7 @@ export default class MainScene extends Scene { ...@@ -355,7 +355,7 @@ export default class MainScene extends Scene {
festivalContainer:egret.DisplayObjectContainer; festivalContainer:egret.DisplayObjectContainer;
constructor(){ constructor(){
super(); super();
console.log('mainscene-------constructor'); // console.log('mainscene-------constructor');
window['gm'] = this.gm; window['gm'] = this.gm;
//基础ui //基础ui
//目标 //目标
...@@ -451,7 +451,7 @@ export default class MainScene extends Scene { ...@@ -451,7 +451,7 @@ export default class MainScene extends Scene {
super.start(); super.start();
this.resetMainScene(); this.resetMainScene();
console.log("mainscene---------start",data,data.chapter); // console.log("mainscene---------start",data,data.chapter);
// window['gm'] = this.gm; // window['gm'] = this.gm;
//第几关 //第几关
this.chapter = (data && data.chapter) ? data.chapter : 1; this.chapter = (data && data.chapter) ? data.chapter : 1;
...@@ -1045,7 +1045,7 @@ export default class MainScene extends Scene { ...@@ -1045,7 +1045,7 @@ export default class MainScene extends Scene {
var elements = this.chapterData.map.elements || Tool.setNumber01(this.chapterData.map.lattices.slice()); var elements = this.chapterData.map.elements || Tool.setNumber01(this.chapterData.map.lattices.slice());
//猩猩初始时加入 //猩猩初始时加入
var pongoArr:Array<{tl:number,tr:number,bl:number,br:number}> = new Array(); var pongoArr:Array<{tl:number,tr:number,bl:number,br:number}> = new Array();
console.log("开始initElement",this.chapter); // console.log("开始initElement",this.chapter);
for(let i = 0; i < elements.length; i++) { for(let i = 0; i < elements.length; i++) {
// console.log("initElement遍历-------",i); // console.log("initElement遍历-------",i);
//如果对应格子为空,直接跳过, //如果对应格子为空,直接跳过,
...@@ -1462,7 +1462,7 @@ export default class MainScene extends Scene { ...@@ -1462,7 +1462,7 @@ export default class MainScene extends Scene {
//侦听事件 //侦听事件
initEvents() { initEvents() {
console.log('mainscene-----------开始监听事件----initEvents'); // console.log('mainscene-----------开始监听事件----initEvents');
this.addEventListener(egret.Event.ENTER_FRAME, this.onEnterFrame, this); this.addEventListener(egret.Event.ENTER_FRAME, this.onEnterFrame, this);
this.settingBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_settingBtn, this) this.settingBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_settingBtn, this)
this.questionBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_questionBtn, this) this.questionBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_questionBtn, this)
...@@ -1486,7 +1486,7 @@ export default class MainScene extends Scene { ...@@ -1486,7 +1486,7 @@ export default class MainScene extends Scene {
} }
removeEvents() { removeEvents() {
console.log('mainscene-----移除事件监听------removeEvents'); // console.log('mainscene-----移除事件监听------removeEvents');
this.removeEventListener(egret.Event.ENTER_FRAME, this.onEnterFrame, this); this.removeEventListener(egret.Event.ENTER_FRAME, this.onEnterFrame, this);
this.settingBtn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_settingBtn, this); this.settingBtn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_settingBtn, this);
this.questionBtn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_questionBtn, this) this.questionBtn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_questionBtn, this)
...@@ -5040,7 +5040,7 @@ export default class MainScene extends Scene { ...@@ -5040,7 +5040,7 @@ export default class MainScene extends Scene {
egret.Tween.removeTweens(this.warningCop[0]); egret.Tween.removeTweens(this.warningCop[0]);
egret.Tween.removeTweens(this.warningCop[1]); egret.Tween.removeTweens(this.warningCop[1]);
} }
console.log("页面回收"); // console.log("页面回收");
for(let i=0;i<this.lattices.length;i++){ for(let i=0;i<this.lattices.length;i++){
let ilattice = this.lattices[i]; let ilattice = this.lattices[i];
if(!ilattice)continue; if(!ilattice)continue;
......
This diff is collapsed.
...@@ -41,9 +41,9 @@ export default (type: LatticeType) => { ...@@ -41,9 +41,9 @@ export default (type: LatticeType) => {
darkiceblock = new BlockDarkIce(_state,LatticeType.BLOCK_AND_DARK_ICE); darkiceblock = new BlockDarkIce(_state,LatticeType.BLOCK_AND_DARK_ICE);
}else{ }else{
darkiceblock._state = _state; darkiceblock._state = _state;
iceblock.ice.alpha = 1; darkiceblock.ice.alpha = 1;
iceblock.ice.visible = false; darkiceblock.ice.visible = false;
iceblock.iceCountNum = 2; darkiceblock.iceCountNum = 2;
} }
return darkiceblock; return darkiceblock;
default: default:
......
...@@ -262,12 +262,14 @@ export class Element extends eui.Component { ...@@ -262,12 +262,14 @@ export class Element extends eui.Component {
* @param part * @param part
*/ */
setPongoPart(part:string){ setPongoPart(part:string){
this.showImage.alpha = 0;
this.inPongoPart = part; this.inPongoPart = part;
// console.log("我是猩猩的"+part); // console.log("我是猩猩的"+part);
if(part=="tl"){ if(part=="tl"){
} }
this.showImage.alpha = 0.5; // this.showImage.alpha = 0.5;
var state = StateType.PongoLockState; var state = StateType.PongoLockState;
if(this.hasState(state)){ if(this.hasState(state)){
...@@ -979,7 +981,7 @@ export class Element extends eui.Component { ...@@ -979,7 +981,7 @@ export class Element extends eui.Component {
if(this._mv&&this._mv.parent){ if(this._mv&&this._mv.parent){
this._mv.removeEventListener(egret.Event.ENTER_FRAME,this._mvEnterFrame1,this); this._mv.removeEventListener(egret.Event.ENTER_FRAME,this._mvEnterFrame1,this);
this._mv.parent.removeChild(this._mv); this._mv.parent.removeChild(this._mv);
console.log("有怪物",type); // console.log("有怪物",type);
} }
if(this._fireworks&&this._fireworks.parent){ if(this._fireworks&&this._fireworks.parent){
this._fireworks.parent.removeChild(this._fireworks); this._fireworks.parent.removeChild(this._fireworks);
......
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