|
|
@@ -67,6 +67,15 @@ export default class Game extends cc.Component {
|
|
|
@property({ type: cc.Node, displayName: '增加效果文本3' })
|
|
|
ani_add3: cc.Node = null;
|
|
|
|
|
|
+ @property({ type: cc.Node, displayName: '加经验效果' })
|
|
|
+ node_addExp: cc.Node = null;
|
|
|
+ @property({ type: cc.Label, displayName: '加经验文本' })
|
|
|
+ lbl_addExp: cc.Label = null;
|
|
|
+ @property({ type: cc.Node, displayName: '加红包币效果' })
|
|
|
+ node_addHb: cc.Node = null;
|
|
|
+ @property({ type: cc.Label, displayName: '加红包币文本' })
|
|
|
+ lbl_addHb: cc.Label = null;
|
|
|
+
|
|
|
posY = 0;
|
|
|
/** 是否开始增加次数倒计时 */
|
|
|
private lastTimeSpan = 0;
|
|
|
@@ -86,6 +95,7 @@ export default class Game extends cc.Component {
|
|
|
if (mk.ad.ifShowAd) {
|
|
|
JsbSystem.showSplash();
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
|
|
|
start() {
|
|
|
@@ -99,7 +109,7 @@ export default class Game extends cc.Component {
|
|
|
// if(gData.sign.redPoint() && this.autoPopSign)
|
|
|
// {
|
|
|
// let id = gData.gameData.getProp(GameProp.guideID);
|
|
|
-
|
|
|
+
|
|
|
// if(id >= 1)
|
|
|
// {
|
|
|
// mk.ui.openPanel('module/sign/sign');
|
|
|
@@ -179,7 +189,7 @@ export default class Game extends cc.Component {
|
|
|
private initInfo() {
|
|
|
this.lbl_redMoney.string = gData.gameData.playerProp.redMoney / 100 + "";
|
|
|
gData.gameData.init_coin = false;
|
|
|
-
|
|
|
+
|
|
|
if (gData.gameData.playerProp.userFarmTaskInfo) {
|
|
|
let com = gData.gameData.playerProp.userFarmTaskInfo.completeCount;
|
|
|
let count = gData.gameData.playerProp.userFarmTaskInfo.taskCount;
|
|
|
@@ -204,6 +214,21 @@ export default class Game extends cc.Component {
|
|
|
cc.tween(this.lbl_redMoney.node).to(0.1, { scale: 1.2 }).to(0.05, { scale: 1 }).start();
|
|
|
this.lbl_redMoney.string = gData.gameData.playerProp.redMoney / 100 + "";
|
|
|
gData.gameData.init_coin = false;
|
|
|
+
|
|
|
+ if (gData.gameData.addHb > 0) {
|
|
|
+ let add = gData.gameData.addHb / 100;
|
|
|
+ this.lbl_addHb.string = "+" + add.toString();
|
|
|
+ gData.gameData.addHb = 0;
|
|
|
+
|
|
|
+ {
|
|
|
+ cc.Tween.stopAllByTarget(this.node_addHb);
|
|
|
+ this.node_addHb.active = true;
|
|
|
+ this.node_addHb.scale = 0;
|
|
|
+ cc.tween(this.node_addHb).to(0.1, { scale: 1 }).delay(1).call(() => {
|
|
|
+ this.node_addHb.active = false;
|
|
|
+ }).start();
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
private async initHead() {
|
|
|
@@ -503,9 +528,17 @@ export default class Game extends cc.Component {
|
|
|
|
|
|
public playAdd(exp, type = 1) {
|
|
|
if (type == 1) {
|
|
|
- this.ani_add.node.getComponent(cc.Label).string = `+${exp}`;
|
|
|
- this.ani_add.node.active = true;
|
|
|
- this.ani_add.play();
|
|
|
+ // this.ani_add.node.getComponent(cc.Label).string = `+${exp}`;
|
|
|
+ // this.ani_add.node.active = true;
|
|
|
+ // this.ani_add.play();
|
|
|
+
|
|
|
+ cc.Tween.stopAllByTarget(this.node_addExp);
|
|
|
+ this.node_addExp.active = true;
|
|
|
+ this.node_addExp.scale = 0;
|
|
|
+ this.lbl_addExp.string = `+${exp}`;
|
|
|
+ cc.tween(this.node_addExp).to(0.1, { scale: 1 }).delay(1).call(() => {
|
|
|
+ this.node_addExp.active = false;
|
|
|
+ }).start();
|
|
|
} else {
|
|
|
|
|
|
this.ani_add2.getComponent(cc.Label).string = `生产次数+${exp}`;
|