Commit ef9b23b9 authored by zjz1994's avatar zjz1994

糖果变特效出问题

parent cb1a1f61
......@@ -1486,7 +1486,7 @@ export default class MainScene extends Scene {
const ele: Element = this.lattices[i].element;
if(isCandyEle) { //糖果元素
if(baseElement == CandyBaseElementType.RANDOM) {//如果是随机糖果,目前只有随机糖果
ele.resetToCandyView(convertBaseElementType(ele.type));//切换成糖果视图
ele.resetToCandyView(convertBaseElementType(ele.type),this);//切换成糖果视图
} else {
// const baseType = convertCandyBaseElementType(resultBaseElement);
// ele.resetType(baseType);//先重置ele类型
......@@ -5728,4 +5728,11 @@ export default class MainScene extends Scene {
}
}
//新增糖果转特效元素处理
setCandyToEffect(){
this.playAni(RecoverName.STEP_ANI, [50, 100]);
setTimeout(() => {
this.steps += 5;
}, 333)
}
}
\ No newline at end of file
......@@ -240,6 +240,17 @@ export const Chapters26: ChapterData[] = [
1, 1, 1, 1, 11, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1 ], baseElements: [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ], recycles: [], generateLats: [ { index: 3, type: null }, { index: 5, type: null }, { index: 10, type: null }, { index: 11, type: null }, { index: 13, type: null }, { index: 16, type: null }, { index: 24, type: null }, { index: 27, type: null }, { index: 35, type: null } ] } },
1, 1, 1, 1, 1, 1, 1, 1, 1 ],
baseElements: [
0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0
], recycles: [], generateLats: [ { index: 3, type: null }, { index: 5, type: null }, { index: 10, type: null }, { index: 11, type: null }, { index: 13, type: null }, { index: 16, type: null }, { index: 24, type: null }, { index: 27, type: null }, { index: 35, type: null } ] } },
]
......@@ -222,7 +222,10 @@ export class Element extends eui.Component {
}
private _candy: Candy;
resetToCandyView(baseElement: CandyBaseElementType) {
resetToCandyView(baseElement: CandyBaseElementType,mainscene?) {
if(mainscene){
this.mainScene = mainscene;
}
const res = transElementRes(baseElement);
this.changeSource("ele" + res + "_png");
......@@ -599,6 +602,10 @@ export class Element extends eui.Component {
if(this._fireworks&&this._fireworks.parent){
this._fireworks.parent.removeChild(this._fireworks);
}
if(this.candy&&this.candy.parent){
this.candy.parent.removeChild(this.candy);
this._candy = null;
}
}
......@@ -754,6 +761,17 @@ export class Element extends eui.Component {
}
set effectType(value: EffectType) {
//糖果被直接设置成特效元素
if(this.candy&&this.candy.step){
this.playCandyDieAni();
this.candy.visible = false;
egret.Tween.removeTweens(this.showImage);
this.showImage.scaleX = 1;
this.showImage.scaleY = 1;
this.showImage.alpha = 1;
this.mainScene&&this.mainScene.setCandyToEffect();
}
if (this.monster) {
value = null;
}
......
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