|
@@ -169,8 +169,7 @@ export default class GamePlay extends cc.Component {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//刷新计时
|
|
//刷新计时
|
|
|
- private curTime = 0;
|
|
|
|
|
- private isAllShow = false;
|
|
|
|
|
|
|
+ public isAllShow = false;
|
|
|
private isShowRedPacket = true;
|
|
private isShowRedPacket = true;
|
|
|
|
|
|
|
|
// LIFE-CYCLE CALLBACKS:
|
|
// LIFE-CYCLE CALLBACKS:
|
|
@@ -1216,35 +1215,49 @@ export default class GamePlay extends cc.Component {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public doBubbleRedPacketLogic(dt) {
|
|
public doBubbleRedPacketLogic(dt) {
|
|
|
|
|
+
|
|
|
if (!this.isShowRedPacket) {
|
|
if (!this.isShowRedPacket) {
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
if (this.isAllShow) {
|
|
if (this.isAllShow) {
|
|
|
|
|
+ if(gData.gameData.redPacketShowCount != 0)
|
|
|
|
|
+ {
|
|
|
|
|
+ gData.gameData.redPacketShowCount = 0;
|
|
|
|
|
+ }
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- this.curTime += dt;
|
|
|
|
|
-
|
|
|
|
|
- if (this.curTime >= gData.gameData.redPacketTime * 60) {
|
|
|
|
|
- this.curTime = 0;
|
|
|
|
|
|
|
+ let count = 0;
|
|
|
|
|
+ let len = gData.gameData.redPacketShowCount;
|
|
|
|
|
+ for(let i = 0; i != len; ++i)
|
|
|
|
|
+ {
|
|
|
if (!this.btn_gameGetRed1.active) {
|
|
if (!this.btn_gameGetRed1.active) {
|
|
|
this.btn_gameGetRed1.active = true;
|
|
this.btn_gameGetRed1.active = true;
|
|
|
- //cc.tween(this.btn_getRed1).to(1.2, { y: 100 }).to(1.2, { y: 50 }).union().repeatForever().start();
|
|
|
|
|
- return;
|
|
|
|
|
|
|
+ ++count;
|
|
|
|
|
+ continue;
|
|
|
} else if (!this.btn_gameGetRed2.active) {
|
|
} else if (!this.btn_gameGetRed2.active) {
|
|
|
this.btn_gameGetRed2.active = true;
|
|
this.btn_gameGetRed2.active = true;
|
|
|
- //cc.tween(this.btn_getRed2).delay(0.2).to(1.5, { y: 125 }).to(1.5, { y: 50 }).union().repeatForever().start();
|
|
|
|
|
- return;
|
|
|
|
|
|
|
+ ++count;
|
|
|
|
|
+ continue;
|
|
|
} else if (!this.btn_gameGetRed3.active) {
|
|
} else if (!this.btn_gameGetRed3.active) {
|
|
|
this.btn_gameGetRed3.active = true;
|
|
this.btn_gameGetRed3.active = true;
|
|
|
- //cc.tween(this.btn_getRed3).delay(0.4).to(1, { y: 10 }).to(1, { y: -50 }).union().repeatForever().start();
|
|
|
|
|
- return;
|
|
|
|
|
|
|
+ ++count;
|
|
|
|
|
+ continue;
|
|
|
} else if (!this.btn_gameGetRed4.active) {
|
|
} else if (!this.btn_gameGetRed4.active) {
|
|
|
this.btn_gameGetRed4.active = true;
|
|
this.btn_gameGetRed4.active = true;
|
|
|
|
|
+ ++count;
|
|
|
|
|
+ continue;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
this.isAllShow = true;
|
|
this.isAllShow = true;
|
|
|
|
|
+ gData.gameData.redPacketShowCount = 0;
|
|
|
|
|
+ count = 0;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if(count > 0)
|
|
|
|
|
+ {
|
|
|
|
|
+ gData.gameData.redPacketShowCount -= count;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private refreshRedPacketUI(index) {
|
|
private refreshRedPacketUI(index) {
|