Commit 251bce34 authored by zjz1994's avatar zjz1994

优化暂存

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