|
@@ -13,12 +13,25 @@ export class car_info extends base_ui {
|
|
@property(Node) lab_car_name:Node = null
|
|
@property(Node) lab_car_name:Node = null
|
|
@property(Node) lab_score:Node = null
|
|
@property(Node) lab_score:Node = null
|
|
|
|
|
|
|
|
+ @property(Node) img_suo:Node = null
|
|
|
|
+
|
|
|
|
+ @property(Node) node_chongci:Node = null
|
|
@property(Node) lab_chongci:Node = null
|
|
@property(Node) lab_chongci:Node = null
|
|
|
|
+
|
|
|
|
+ @property(Node) node_qiyou:Node = null
|
|
@property(Node) lab_qiyou:Node = null
|
|
@property(Node) lab_qiyou:Node = null
|
|
|
|
+
|
|
|
|
+ @property(Node) node_dunpai:Node = null
|
|
@property(Node) lab_dunpai:Node = null
|
|
@property(Node) lab_dunpai:Node = null
|
|
|
|
+
|
|
|
|
+ @property(Node) node_xingxing:Node = null
|
|
@property(Node) lab_xingxing:Node = null
|
|
@property(Node) lab_xingxing:Node = null
|
|
|
|
+
|
|
|
|
+ @property(Node) node_citie:Node = null
|
|
@property(Node) lab_citie:Node = null
|
|
@property(Node) lab_citie:Node = null
|
|
|
|
|
|
|
|
+ @property(Node) lab_no_shuxing:Node = null
|
|
|
|
+
|
|
start() {
|
|
start() {
|
|
this.onButtonListen(this.btn_close, ()=>{
|
|
this.onButtonListen(this.btn_close, ()=>{
|
|
this.close()
|
|
this.close()
|
|
@@ -27,6 +40,7 @@ export class car_info extends base_ui {
|
|
|
|
|
|
initView(data:car_item_data, is_jiesuo:boolean) {
|
|
initView(data:car_item_data, is_jiesuo:boolean) {
|
|
if(is_jiesuo) {
|
|
if(is_jiesuo) {
|
|
|
|
+ this.img_suo.active = false
|
|
this.lab_car_name.active = false
|
|
this.lab_car_name.active = false
|
|
this.lab_xiangcha_score.getComponent(Label).string = data.name
|
|
this.lab_xiangcha_score.getComponent(Label).string = data.name
|
|
} else {
|
|
} else {
|
|
@@ -40,6 +54,7 @@ export class car_info extends base_ui {
|
|
let xiangcha_score = 100
|
|
let xiangcha_score = 100
|
|
this.lab_xiangcha_score.getComponent(Label).string = `距离解锁还差 ${xiangcha_score} 碎片`
|
|
this.lab_xiangcha_score.getComponent(Label).string = `距离解锁还差 ${xiangcha_score} 碎片`
|
|
}
|
|
}
|
|
|
|
+ this.img_suo.active = true
|
|
this.lab_car_name.active = true
|
|
this.lab_car_name.active = true
|
|
this.lab_car_name.getComponent(Label).string = data.name
|
|
this.lab_car_name.getComponent(Label).string = data.name
|
|
}
|
|
}
|
|
@@ -52,17 +67,48 @@ export class car_info extends base_ui {
|
|
this.lab_score.getComponent(Label).string = `已集齐 ${0} / ${data.unlock_points}`
|
|
this.lab_score.getComponent(Label).string = `已集齐 ${0} / ${data.unlock_points}`
|
|
}
|
|
}
|
|
|
|
|
|
- if(data.attribute.k_sprint_cd==0) { this.lab_chongci.active = false }
|
|
|
|
- if(data.attribute.k_oil_number==0) { this.lab_qiyou.active = false }
|
|
|
|
- if(data.attribute.n_shield_cd==0) { this.lab_dunpai.active = false }
|
|
|
|
- if(data.attribute.n_star_cd==0) { this.lab_xingxing.active = false }
|
|
|
|
- if(data.attribute.n_magnet_cd==0) { this.lab_citie.active = false }
|
|
|
|
-
|
|
|
|
- this.lab_chongci.getComponent(Label).string = `+${data.attribute.k_sprint_cd}秒`
|
|
|
|
- this.lab_qiyou.getComponent(Label).string = `+${data.attribute.k_oil_number}桶`
|
|
|
|
- this.lab_dunpai.getComponent(Label).string = `+${data.attribute.n_shield_cd}秒`
|
|
|
|
- this.lab_xingxing.getComponent(Label).string = `+${data.attribute.n_star_cd}秒`
|
|
|
|
- this.lab_citie.getComponent(Label).string = `+${data.attribute.n_magnet_cd}秒`
|
|
|
|
|
|
+ let count = 0
|
|
|
|
+ if(data.attribute.k_sprint_cd<=0) {
|
|
|
|
+ this.node_chongci.active = false
|
|
|
|
+ } else {
|
|
|
|
+ count+=1
|
|
|
|
+ this.lab_chongci.getComponent(Label).string = `+${data.attribute.k_sprint_cd}秒`
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if(data.attribute.k_oil_number<=0) {
|
|
|
|
+ this.node_qiyou.active = false
|
|
|
|
+ } else {
|
|
|
|
+ count+=1
|
|
|
|
+ this.lab_qiyou.getComponent(Label).string = `+${data.attribute.k_oil_number}桶`
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if(data.attribute.n_shield_cd==0) {
|
|
|
|
+ this.node_dunpai.active = false
|
|
|
|
+ } else {
|
|
|
|
+ count+=1
|
|
|
|
+ this.lab_dunpai.getComponent(Label).string = `+${data.attribute.n_shield_cd}秒`
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if(data.attribute.n_star_cd==0) {
|
|
|
|
+ this.node_xingxing.active = false
|
|
|
|
+ } else {
|
|
|
|
+ count+=1
|
|
|
|
+ this.lab_xingxing.getComponent(Label).string = `+${data.attribute.n_star_cd}秒`
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if(data.attribute.n_magnet_cd==0) {
|
|
|
|
+ this.node_citie.active = false
|
|
|
|
+ } else {
|
|
|
|
+ count+=1
|
|
|
|
+ this.lab_citie.getComponent(Label).string = `+${data.attribute.n_magnet_cd}秒`
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if(count==0) {
|
|
|
|
+ this.lab_no_shuxing.active = true
|
|
|
|
+ } else {
|
|
|
|
+ this.lab_no_shuxing.active = false
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|