|
@@ -62,15 +62,16 @@ export default class Game extends cc.Component {
|
|
|
@property({ type: cc.Sprite, displayName: '等级名字' })
|
|
@property({ type: cc.Sprite, displayName: '等级名字' })
|
|
|
sp_gradeName: cc.Sprite = null;
|
|
sp_gradeName: cc.Sprite = null;
|
|
|
|
|
|
|
|
- @property({ type: cc.Animation, displayName: '增加效果文本2' })
|
|
|
|
|
- ani_add2: cc.Animation = null;
|
|
|
|
|
-
|
|
|
|
|
|
|
+ @property({ type: cc.Node, displayName: '增加效果文本2' })
|
|
|
|
|
+ ani_add2: cc.Node = null;
|
|
|
|
|
|
|
|
|
|
+ posY = 0;
|
|
|
/** 是否开始增加次数倒计时 */
|
|
/** 是否开始增加次数倒计时 */
|
|
|
private lastTimeSpan = 0;
|
|
private lastTimeSpan = 0;
|
|
|
private span = 0;
|
|
private span = 0;
|
|
|
|
|
|
|
|
onLoad() {
|
|
onLoad() {
|
|
|
|
|
+ this.posY = this.ani_add2.y;
|
|
|
this.ani_add.node.active = false;
|
|
this.ani_add.node.active = false;
|
|
|
gData.gameData.gameStyle = this;
|
|
gData.gameData.gameStyle = this;
|
|
|
this.span = gData.gameData.ProductionRecovery * 60 * 1000;
|
|
this.span = gData.gameData.ProductionRecovery * 60 * 1000;
|
|
@@ -416,7 +417,8 @@ export default class Game extends cc.Component {
|
|
|
/** 点击种植 */
|
|
/** 点击种植 */
|
|
|
public async onClickPlant() {
|
|
public async onClickPlant() {
|
|
|
mk.audio.playEffect("button");
|
|
mk.audio.playEffect("button");
|
|
|
- if (gData.gameData.leftTimes <= 0) {
|
|
|
|
|
|
|
+ if (gData.gameData.leftTimes <= 0)
|
|
|
|
|
+ {
|
|
|
// mk.tip.pop('生产次数不足');
|
|
// mk.tip.pop('生产次数不足');
|
|
|
mk.ui.openPanel('module/speedUpUI/productReward');
|
|
mk.ui.openPanel('module/speedUpUI/productReward');
|
|
|
return;
|
|
return;
|
|
@@ -439,19 +441,32 @@ export default class Game extends cc.Component {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- public dpFlyRedAni(starPos: cc.Vec2 = null) {
|
|
|
|
|
- if (starPos) {
|
|
|
|
|
- let pos = this.node_taskHb.parent.convertToWorldSpaceAR(this.node_taskHb.getPosition());
|
|
|
|
|
- mk.fly.PlayCoinAnim(1, 5, starPos, pos, () => {
|
|
|
|
|
- gData.gameData.init_task = true;
|
|
|
|
|
- }, 0.8);
|
|
|
|
|
- } else {
|
|
|
|
|
- let pos = this.node_taskHb.parent.convertToWorldSpaceAR(this.node_taskHb.getPosition());
|
|
|
|
|
- mk.fly.PlayCoinAnim(1, 5, this.btn_product, pos, () => {
|
|
|
|
|
|
|
+ public dpFlyRedAni(starPos: cc.Vec2 = null)
|
|
|
|
|
+ {
|
|
|
|
|
+ if(starPos)
|
|
|
|
|
+ {
|
|
|
|
|
+ if(this.node_taskHb && this.node_taskHb.parent)
|
|
|
|
|
+ {
|
|
|
|
|
+ let pos = this.node_taskHb.parent.convertToWorldSpaceAR(this.node_taskHb.getPosition());
|
|
|
|
|
+ mk.fly.PlayCoinAnim(1, 5, starPos, pos, () => {
|
|
|
|
|
+ gData.gameData.init_task = true;
|
|
|
|
|
+ }, 0.8);
|
|
|
|
|
+ }else{
|
|
|
gData.gameData.init_task = true;
|
|
gData.gameData.init_task = true;
|
|
|
- }, 0.8);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ }else{
|
|
|
|
|
|
|
|
|
|
+ if(this.node_taskHb && this.node_taskHb.parent && this.btn_product)
|
|
|
|
|
+ {
|
|
|
|
|
+ let pos = this.node_taskHb.parent.convertToWorldSpaceAR(this.node_taskHb.getPosition());
|
|
|
|
|
+ mk.fly.PlayCoinAnim(1, 5, this.btn_product, pos, () => {
|
|
|
|
|
+ gData.gameData.init_task = true;
|
|
|
|
|
+ }, 0.8);
|
|
|
|
|
+ }else{
|
|
|
|
|
+ gData.gameData.init_task = true;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@@ -484,10 +499,14 @@ export default class Game extends cc.Component {
|
|
|
this.ani_add.node.getComponent(cc.Label).string = `+${exp}`;
|
|
this.ani_add.node.getComponent(cc.Label).string = `+${exp}`;
|
|
|
this.ani_add.node.active = true;
|
|
this.ani_add.node.active = true;
|
|
|
this.ani_add.play();
|
|
this.ani_add.play();
|
|
|
- } else {
|
|
|
|
|
- this.ani_add2.node.getComponent(cc.Label).string = `+${exp}`;
|
|
|
|
|
- this.ani_add2.node.active = true;
|
|
|
|
|
- this.ani_add2.play();
|
|
|
|
|
|
|
+ }else{
|
|
|
|
|
+
|
|
|
|
|
+ this.ani_add2.getComponent(cc.Label).string = `生产次数+${exp}`;
|
|
|
|
|
+ cc.tween(this.ani_add2).delay(1.3).call(()=>{
|
|
|
|
|
+ this.ani_add2.opacity = 255;
|
|
|
|
|
+ }).by(0.8, {y : 100}).to(0.4, {opacity : 0}).call(()=>{
|
|
|
|
|
+ this.ani_add2.y = this.posY;
|
|
|
|
|
+ }).start();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// gData.gameData.init_add = false;
|
|
// gData.gameData.init_add = false;
|