|
|
@@ -25,15 +25,15 @@ export default class RedBagTask extends cc.Component {
|
|
|
@property(cc.Animation)
|
|
|
private node_cash: cc.Animation = null;
|
|
|
|
|
|
- @property({type: cc.Node, displayName: '显示金额节点'})
|
|
|
+ @property({ type: cc.Node, displayName: '显示金额节点' })
|
|
|
private node_value: cc.Node = null;
|
|
|
- @property({type: cc.Node, displayName: '任务节点'})
|
|
|
+ @property({ type: cc.Node, displayName: '任务节点' })
|
|
|
private node_task: cc.Node = null;
|
|
|
- @property({type: cc.Label, displayName: '动画显示文字'})
|
|
|
+ @property({ type: cc.Label, displayName: '动画显示文字' })
|
|
|
private lbl_Ani: cc.Label = null;
|
|
|
- @property({type: cc.Label, displayName: '任务数量'})
|
|
|
+ @property({ type: cc.Label, displayName: '任务数量' })
|
|
|
private lbl_taskNum: cc.Label = null;
|
|
|
- @property({type: cc.Label, displayName: '任务描述'})
|
|
|
+ @property({ type: cc.Label, displayName: '任务描述' })
|
|
|
private lbl_taskDes: cc.Label = null;
|
|
|
|
|
|
private isShowNewTask = false;
|
|
|
@@ -46,14 +46,13 @@ export default class RedBagTask extends cc.Component {
|
|
|
start() {
|
|
|
mk.ad.showBanner();
|
|
|
|
|
|
- if(this.isShowNewTask)
|
|
|
- {
|
|
|
+ if (this.isShowNewTask) {
|
|
|
this.node_value.active = false;
|
|
|
this.node_task.active = false;
|
|
|
this.node_cash.node.active = false;
|
|
|
this.lbl_Ani.node.active = true;
|
|
|
-
|
|
|
- }else{
|
|
|
+
|
|
|
+ } else {
|
|
|
//this.node_value.active = true;
|
|
|
//this.node_task.active = true;
|
|
|
//this.node_cash.node.active = true;
|
|
|
@@ -61,9 +60,9 @@ export default class RedBagTask extends cc.Component {
|
|
|
this.showChangePart();
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+
|
|
|
this.initCashOutStyle(gData.gameData.gameData.redMoney);
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
|
|
|
onEnable() {
|
|
|
@@ -72,6 +71,7 @@ export default class RedBagTask extends cc.Component {
|
|
|
|
|
|
onDisable() {
|
|
|
mk.ad.destoryBanner();
|
|
|
+ mk.guide.open(2);
|
|
|
}
|
|
|
|
|
|
update(dt) {
|
|
|
@@ -80,46 +80,41 @@ export default class RedBagTask extends cc.Component {
|
|
|
this.initCashOutStyle(gData.gameData.gameData.redMoney + gData.reward.add_redbag_value);
|
|
|
}
|
|
|
|
|
|
- if(this.isShowNewTask)
|
|
|
- {
|
|
|
- if(this.delayTime <= 0.6)
|
|
|
- {
|
|
|
+ if (this.isShowNewTask) {
|
|
|
+ if (this.delayTime <= 0.6) {
|
|
|
this.delayTime += dt;
|
|
|
- }else
|
|
|
- {
|
|
|
- this.times +=1;
|
|
|
- if(this.times == 2)
|
|
|
- {
|
|
|
+ } else {
|
|
|
+ this.times += 1;
|
|
|
+ if (this.times == 2) {
|
|
|
this.times = 0;
|
|
|
- this.num +=1;
|
|
|
- this.lbl_Ani.string = this.num.toString();
|
|
|
-
|
|
|
- if(this.num == 14)
|
|
|
- {
|
|
|
- this.isShowNewTask = false;
|
|
|
-
|
|
|
- this.lbl_Ani.node.color = new cc.Color(255, 218, 49);
|
|
|
- let clone = cc.instantiate(this.lbl_Ani.node);
|
|
|
- clone.parent = this.lbl_Ani.node.parent;
|
|
|
- cc.tween(clone).to(1.2, {scale: 4.0, opacity: 0}).call(()=>{
|
|
|
- clone.active = false;
|
|
|
- let worldPos = this.lbl_taskNum.node.parent.convertToWorldSpaceAR(this.lbl_taskNum.node.position);
|
|
|
- let pos = this.lbl_taskNum.node.parent.parent.convertToNodeSpaceAR(worldPos);
|
|
|
- cc.tween(this.lbl_Ani).to(0.6, {fontSize: 40}).start();
|
|
|
- cc.tween(this.lbl_Ani.node).to(0.6,{position: pos}, cc.easeSineOut()).call(()=>{
|
|
|
- this.lbl_Ani.node.active = false;
|
|
|
- this.node_task.active = true;
|
|
|
- cc.tween(this.node_task).by(0.16, {y: -6}).by(0.1, {y: 6}).start();
|
|
|
+ this.num += 1;
|
|
|
+ this.lbl_Ani.string = this.num.toString();
|
|
|
+
|
|
|
+ if (this.num == 14) {
|
|
|
+ this.isShowNewTask = false;
|
|
|
+
|
|
|
+ this.lbl_Ani.node.color = new cc.Color(255, 218, 49);
|
|
|
+ let clone = cc.instantiate(this.lbl_Ani.node);
|
|
|
+ clone.parent = this.lbl_Ani.node.parent;
|
|
|
+ cc.tween(clone).to(1.2, { scale: 4.0, opacity: 0 }).call(() => {
|
|
|
+ clone.active = false;
|
|
|
+ let worldPos = this.lbl_taskNum.node.parent.convertToWorldSpaceAR(this.lbl_taskNum.node.position);
|
|
|
+ let pos = this.lbl_taskNum.node.parent.parent.convertToNodeSpaceAR(worldPos);
|
|
|
+ cc.tween(this.lbl_Ani).to(0.6, { fontSize: 40 }).start();
|
|
|
+ cc.tween(this.lbl_Ani.node).to(0.6, { position: pos }, cc.easeSineOut()).call(() => {
|
|
|
+ this.lbl_Ani.node.active = false;
|
|
|
+ this.node_task.active = true;
|
|
|
+ cc.tween(this.node_task).by(0.16, { y: -6 }).by(0.1, { y: 6 }).start();
|
|
|
+ }).start();
|
|
|
+
|
|
|
+ this.node_value.active = true;
|
|
|
+ this.node_value.scale = 0;
|
|
|
+ cc.tween(this.node_value).to(0.76, { scale: 1.3 }, cc.easeSineOut()).to(0.1, { scale: 1 }).start();
|
|
|
}).start();
|
|
|
-
|
|
|
- this.node_value.active = true;
|
|
|
- this.node_value.scale = 0;
|
|
|
- cc.tween(this.node_value).to(0.76, {scale: 1.3}, cc.easeSineOut()).to(0.1, {scale: 1}).start();
|
|
|
- }).start();
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
|