|
@@ -57,8 +57,15 @@ export default class Game extends cc.Component {
|
|
|
@property({ type: cc.Label, displayName: "种植次数文本" })
|
|
@property({ type: cc.Label, displayName: "种植次数文本" })
|
|
|
lbl_leftTimes: cc.Label = null;
|
|
lbl_leftTimes: cc.Label = null;
|
|
|
|
|
|
|
|
- @property({type: cc.Label, displayName: '任务文本'})
|
|
|
|
|
- lbl_task: cc.Label = null;
|
|
|
|
|
|
|
+ @property({type: cc.RichText, displayName: '任务文本'})
|
|
|
|
|
+ lbl_task: cc.RichText = null;
|
|
|
|
|
+
|
|
|
|
|
+ @property({type: cc.Node, displayName: '任务红包节点'})
|
|
|
|
|
+ node_taskHb: cc.Node = null;
|
|
|
|
|
+
|
|
|
|
|
+ @property({type: cc.Node, displayName: '生产按钮节点'})
|
|
|
|
|
+ btn_product: cc.Node = null;
|
|
|
|
|
+
|
|
|
|
|
|
|
|
/** 是否开始增加次数倒计时 */
|
|
/** 是否开始增加次数倒计时 */
|
|
|
private leftTimesScheduleOn = false;
|
|
private leftTimesScheduleOn = false;
|
|
@@ -136,6 +143,11 @@ export default class Game extends cc.Component {
|
|
|
this.initLeftTimes();
|
|
this.initLeftTimes();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ if( gData.gameData.init_task)
|
|
|
|
|
+ {
|
|
|
|
|
+ this.changeTaskUI();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
if (gData.gameData.leftTimes < gData.gameData.maxTimes && this.lastTimeSpan != 0) {
|
|
if (gData.gameData.leftTimes < gData.gameData.maxTimes && this.lastTimeSpan != 0) {
|
|
|
let pass = Date.now() - this.lastTimeSpan;
|
|
let pass = Date.now() - this.lastTimeSpan;
|
|
|
if (pass >= this.span) {
|
|
if (pass >= this.span) {
|
|
@@ -180,6 +192,8 @@ export default class Game extends cc.Component {
|
|
|
private initInfo() {
|
|
private initInfo() {
|
|
|
this.lbl_redMoney.string = gData.gameData.gameData.redMoney + "";
|
|
this.lbl_redMoney.string = gData.gameData.gameData.redMoney + "";
|
|
|
gData.gameData.init_coin = false;
|
|
gData.gameData.init_coin = false;
|
|
|
|
|
+
|
|
|
|
|
+ this.lbl_task.string = `<outline color=#914128 width =2><color=#FCFDFB>完成100次收获</c><color=#66FF3D>(1/100)</color></outline>`
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private changeInfo() {
|
|
private changeInfo() {
|
|
@@ -194,6 +208,13 @@ export default class Game extends cc.Component {
|
|
|
//this.img_head.spriteFrame = new cc.SpriteFrame(result);
|
|
//this.img_head.spriteFrame = new cc.SpriteFrame(result);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ private changeTaskUI()
|
|
|
|
|
+ {
|
|
|
|
|
+ cc.tween(this.lbl_task.node).to(0.1, {scale: 1.2}).to(0.1, {scale: 1}).start();
|
|
|
|
|
+ this.lbl_task.string = `<outline color=#914128 width =2><color=#FCFDFB>完成100次收获</c><color=#66FF3D>(1/100)</color></outline>`
|
|
|
|
|
+ gData.gameData.init_task = false;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 初始化红点
|
|
* 初始化红点
|
|
|
*/
|
|
*/
|
|
@@ -342,6 +363,13 @@ export default class Game extends cc.Component {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
gData.gameData.makeProduct();
|
|
gData.gameData.makeProduct();
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ let pos = this.node_taskHb.parent.convertToWorldSpaceAR(this.node_taskHb.getPosition());
|
|
|
|
|
+ mk.fly.PlayCoinAnim(1, 3, this.btn_product, pos, ()=>{
|
|
|
|
|
+
|
|
|
|
|
+ gData.gameData.init_task = true;
|
|
|
|
|
+ })
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|