future 1 year ago
parent
commit
17a207e381
2 changed files with 282 additions and 53 deletions
  1. 225 42
      assets/resources/ui/car_info.prefab
  2. 57 11
      assets/script/ui/car_info.ts

+ 225 - 42
assets/resources/ui/car_info.prefab

@@ -25,29 +25,29 @@
         "__id__": 10
         "__id__": 10
       },
       },
       {
       {
-        "__id__": 226
+        "__id__": 232
       }
       }
     ],
     ],
     "_active": true,
     "_active": true,
     "_components": [
     "_components": [
       {
       {
-        "__id__": 234
+        "__id__": 240
       },
       },
       {
       {
-        "__id__": 236
+        "__id__": 242
       },
       },
       {
       {
-        "__id__": 238
+        "__id__": 244
       },
       },
       {
       {
-        "__id__": 240
+        "__id__": 246
       },
       },
       {
       {
-        "__id__": 242
+        "__id__": 248
       }
       }
     ],
     ],
     "_prefab": {
     "_prefab": {
-      "__id__": 244
+      "__id__": 250
     },
     },
     "_lpos": {
     "_lpos": {
       "__type__": "cc.Vec3",
       "__type__": "cc.Vec3",
@@ -275,20 +275,20 @@
         "__id__": 35
         "__id__": 35
       },
       },
       {
       {
-        "__id__": 215
+        "__id__": 221
       }
       }
     ],
     ],
     "_active": true,
     "_active": true,
     "_components": [
     "_components": [
       {
       {
-        "__id__": 221
+        "__id__": 227
       },
       },
       {
       {
-        "__id__": 223
+        "__id__": 229
       }
       }
     ],
     ],
     "_prefab": {
     "_prefab": {
-      "__id__": 225
+      "__id__": 231
     },
     },
     "_lpos": {
     "_lpos": {
       "__type__": "cc.Vec3",
       "__type__": "cc.Vec3",
@@ -930,19 +930,22 @@
       },
       },
       {
       {
         "__id__": 54
         "__id__": 54
+      },
+      {
+        "__id__": 210
       }
       }
     ],
     ],
     "_active": true,
     "_active": true,
     "_components": [
     "_components": [
       {
       {
-        "__id__": 210
+        "__id__": 216
       },
       },
       {
       {
-        "__id__": 212
+        "__id__": 218
       }
       }
     ],
     ],
     "_prefab": {
     "_prefab": {
-      "__id__": 214
+      "__id__": 220
     },
     },
     "_lpos": {
     "_lpos": {
       "__type__": "cc.Vec3",
       "__type__": "cc.Vec3",
@@ -5328,6 +5331,165 @@
     "targetOverrides": null,
     "targetOverrides": null,
     "nestedPrefabInstanceRoots": null
     "nestedPrefabInstanceRoots": null
   },
   },
+  {
+    "__type__": "cc.Node",
+    "_name": "lab_no_shuxing",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "_parent": {
+      "__id__": 35
+    },
+    "_children": [],
+    "_active": false,
+    "_components": [
+      {
+        "__id__": 211
+      },
+      {
+        "__id__": 213
+      }
+    ],
+    "_prefab": {
+      "__id__": 215
+    },
+    "_lpos": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": -40,
+      "z": 0
+    },
+    "_lrot": {
+      "__type__": "cc.Quat",
+      "x": 0,
+      "y": 0,
+      "z": 0,
+      "w": 1
+    },
+    "_lscale": {
+      "__type__": "cc.Vec3",
+      "x": 1,
+      "y": 1,
+      "z": 1
+    },
+    "_mobility": 0,
+    "_layer": 33554432,
+    "_euler": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": 0,
+      "z": 0
+    },
+    "_id": ""
+  },
+  {
+    "__type__": "cc.UITransform",
+    "_name": "",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "node": {
+      "__id__": 210
+    },
+    "_enabled": true,
+    "__prefab": {
+      "__id__": 212
+    },
+    "_contentSize": {
+      "__type__": "cc.Size",
+      "width": 300,
+      "height": 50.4
+    },
+    "_anchorPoint": {
+      "__type__": "cc.Vec2",
+      "x": 0.5,
+      "y": 0.5
+    },
+    "_id": ""
+  },
+  {
+    "__type__": "cc.CompPrefabInfo",
+    "fileId": "1fqleoLxVPeovB1zhbG7a3"
+  },
+  {
+    "__type__": "cc.Label",
+    "_name": "",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "node": {
+      "__id__": 210
+    },
+    "_enabled": true,
+    "__prefab": {
+      "__id__": 214
+    },
+    "_customMaterial": null,
+    "_srcBlendFactor": 2,
+    "_dstBlendFactor": 4,
+    "_color": {
+      "__type__": "cc.Color",
+      "r": 85,
+      "g": 171,
+      "b": 245,
+      "a": 255
+    },
+    "_string": "无特效属性",
+    "_horizontalAlign": 1,
+    "_verticalAlign": 1,
+    "_actualFontSize": 40,
+    "_fontSize": 40,
+    "_fontFamily": "Arial",
+    "_lineHeight": 40,
+    "_overflow": 1,
+    "_enableWrapText": false,
+    "_font": null,
+    "_isSystemFontUsed": true,
+    "_spacingX": 0,
+    "_isItalic": false,
+    "_isBold": true,
+    "_isUnderline": false,
+    "_underlineHeight": 2,
+    "_cacheMode": 0,
+    "_enableOutline": false,
+    "_outlineColor": {
+      "__type__": "cc.Color",
+      "r": 0,
+      "g": 0,
+      "b": 0,
+      "a": 255
+    },
+    "_outlineWidth": 2,
+    "_enableShadow": false,
+    "_shadowColor": {
+      "__type__": "cc.Color",
+      "r": 0,
+      "g": 0,
+      "b": 0,
+      "a": 255
+    },
+    "_shadowOffset": {
+      "__type__": "cc.Vec2",
+      "x": 2,
+      "y": 2
+    },
+    "_shadowBlur": 2,
+    "_id": ""
+  },
+  {
+    "__type__": "cc.CompPrefabInfo",
+    "fileId": "3f5crK2yJO9qpSJkzJQlAw"
+  },
+  {
+    "__type__": "cc.PrefabInfo",
+    "root": {
+      "__id__": 1
+    },
+    "asset": {
+      "__id__": 0
+    },
+    "fileId": "b024JPHLxDSZ6/ybdMTGgE",
+    "instance": null,
+    "targetOverrides": null,
+    "nestedPrefabInstanceRoots": null
+  },
   {
   {
     "__type__": "cc.UITransform",
     "__type__": "cc.UITransform",
     "_name": "",
     "_name": "",
@@ -5338,7 +5500,7 @@
     },
     },
     "_enabled": true,
     "_enabled": true,
     "__prefab": {
     "__prefab": {
-      "__id__": 211
+      "__id__": 217
     },
     },
     "_contentSize": {
     "_contentSize": {
       "__type__": "cc.Size",
       "__type__": "cc.Size",
@@ -5366,7 +5528,7 @@
     },
     },
     "_enabled": false,
     "_enabled": false,
     "__prefab": {
     "__prefab": {
-      "__id__": 213
+      "__id__": 219
     },
     },
     "_customMaterial": null,
     "_customMaterial": null,
     "_srcBlendFactor": 2,
     "_srcBlendFactor": 2,
@@ -5426,14 +5588,14 @@
     "_active": true,
     "_active": true,
     "_components": [
     "_components": [
       {
       {
-        "__id__": 216
+        "__id__": 222
       },
       },
       {
       {
-        "__id__": 218
+        "__id__": 224
       }
       }
     ],
     ],
     "_prefab": {
     "_prefab": {
-      "__id__": 220
+      "__id__": 226
     },
     },
     "_lpos": {
     "_lpos": {
       "__type__": "cc.Vec3",
       "__type__": "cc.Vec3",
@@ -5470,11 +5632,11 @@
     "_objFlags": 0,
     "_objFlags": 0,
     "__editorExtras__": {},
     "__editorExtras__": {},
     "node": {
     "node": {
-      "__id__": 215
+      "__id__": 221
     },
     },
     "_enabled": true,
     "_enabled": true,
     "__prefab": {
     "__prefab": {
-      "__id__": 217
+      "__id__": 223
     },
     },
     "_contentSize": {
     "_contentSize": {
       "__type__": "cc.Size",
       "__type__": "cc.Size",
@@ -5498,11 +5660,11 @@
     "_objFlags": 0,
     "_objFlags": 0,
     "__editorExtras__": {},
     "__editorExtras__": {},
     "node": {
     "node": {
-      "__id__": 215
+      "__id__": 221
     },
     },
     "_enabled": true,
     "_enabled": true,
     "__prefab": {
     "__prefab": {
-      "__id__": 219
+      "__id__": 225
     },
     },
     "_customMaterial": null,
     "_customMaterial": null,
     "_srcBlendFactor": 2,
     "_srcBlendFactor": 2,
@@ -5583,7 +5745,7 @@
     },
     },
     "_enabled": true,
     "_enabled": true,
     "__prefab": {
     "__prefab": {
-      "__id__": 222
+      "__id__": 228
     },
     },
     "_contentSize": {
     "_contentSize": {
       "__type__": "cc.Size",
       "__type__": "cc.Size",
@@ -5611,7 +5773,7 @@
     },
     },
     "_enabled": true,
     "_enabled": true,
     "__prefab": {
     "__prefab": {
-      "__id__": 224
+      "__id__": 230
     },
     },
     "_customMaterial": null,
     "_customMaterial": null,
     "_srcBlendFactor": 2,
     "_srcBlendFactor": 2,
@@ -5671,17 +5833,17 @@
     "_active": true,
     "_active": true,
     "_components": [
     "_components": [
       {
       {
-        "__id__": 227
+        "__id__": 233
       },
       },
       {
       {
-        "__id__": 229
+        "__id__": 235
       },
       },
       {
       {
-        "__id__": 231
+        "__id__": 237
       }
       }
     ],
     ],
     "_prefab": {
     "_prefab": {
-      "__id__": 233
+      "__id__": 239
     },
     },
     "_lpos": {
     "_lpos": {
       "__type__": "cc.Vec3",
       "__type__": "cc.Vec3",
@@ -5718,11 +5880,11 @@
     "_objFlags": 0,
     "_objFlags": 0,
     "__editorExtras__": {},
     "__editorExtras__": {},
     "node": {
     "node": {
-      "__id__": 226
+      "__id__": 232
     },
     },
     "_enabled": true,
     "_enabled": true,
     "__prefab": {
     "__prefab": {
-      "__id__": 228
+      "__id__": 234
     },
     },
     "_contentSize": {
     "_contentSize": {
       "__type__": "cc.Size",
       "__type__": "cc.Size",
@@ -5746,11 +5908,11 @@
     "_objFlags": 0,
     "_objFlags": 0,
     "__editorExtras__": {},
     "__editorExtras__": {},
     "node": {
     "node": {
-      "__id__": 226
+      "__id__": 232
     },
     },
     "_enabled": true,
     "_enabled": true,
     "__prefab": {
     "__prefab": {
-      "__id__": 230
+      "__id__": 236
     },
     },
     "_customMaterial": null,
     "_customMaterial": null,
     "_srcBlendFactor": 2,
     "_srcBlendFactor": 2,
@@ -5791,11 +5953,11 @@
     "_objFlags": 0,
     "_objFlags": 0,
     "__editorExtras__": {},
     "__editorExtras__": {},
     "node": {
     "node": {
-      "__id__": 226
+      "__id__": 232
     },
     },
     "_enabled": true,
     "_enabled": true,
     "__prefab": {
     "__prefab": {
-      "__id__": 232
+      "__id__": 238
     },
     },
     "clickEvents": [],
     "clickEvents": [],
     "_interactable": true,
     "_interactable": true,
@@ -5864,7 +6026,7 @@
     },
     },
     "_enabled": true,
     "_enabled": true,
     "__prefab": {
     "__prefab": {
-      "__id__": 235
+      "__id__": 241
     },
     },
     "_contentSize": {
     "_contentSize": {
       "__type__": "cc.Size",
       "__type__": "cc.Size",
@@ -5892,7 +6054,7 @@
     },
     },
     "_enabled": true,
     "_enabled": true,
     "__prefab": {
     "__prefab": {
-      "__id__": 237
+      "__id__": 243
     },
     },
     "_alignFlags": 45,
     "_alignFlags": 45,
     "_target": null,
     "_target": null,
@@ -5928,10 +6090,10 @@
     },
     },
     "_enabled": true,
     "_enabled": true,
     "__prefab": {
     "__prefab": {
-      "__id__": 239
+      "__id__": 245
     },
     },
     "btn_close": {
     "btn_close": {
-      "__id__": 226
+      "__id__": 232
     },
     },
     "lab_xiangcha_score": {
     "lab_xiangcha_score": {
       "__id__": 12
       "__id__": 12
@@ -5940,26 +6102,47 @@
       "__id__": 23
       "__id__": 23
     },
     },
     "lab_car_name": {
     "lab_car_name": {
-      "__id__": 215
+      "__id__": 221
     },
     },
     "lab_score": {
     "lab_score": {
       "__id__": 29
       "__id__": 29
     },
     },
+    "img_suo": {
+      "__id__": 48
+    },
+    "node_chongci": {
+      "__id__": 55
+    },
     "lab_chongci": {
     "lab_chongci": {
       "__id__": 74
       "__id__": 74
     },
     },
+    "node_qiyou": {
+      "__id__": 85
+    },
     "lab_qiyou": {
     "lab_qiyou": {
       "__id__": 104
       "__id__": 104
     },
     },
+    "node_dunpai": {
+      "__id__": 115
+    },
     "lab_dunpai": {
     "lab_dunpai": {
       "__id__": 134
       "__id__": 134
     },
     },
+    "node_xingxing": {
+      "__id__": 145
+    },
     "lab_xingxing": {
     "lab_xingxing": {
       "__id__": 164
       "__id__": 164
     },
     },
+    "node_citie": {
+      "__id__": 175
+    },
     "lab_citie": {
     "lab_citie": {
       "__id__": 194
       "__id__": 194
     },
     },
+    "lab_no_shuxing": {
+      "__id__": 210
+    },
     "_id": ""
     "_id": ""
   },
   },
   {
   {
@@ -5976,7 +6159,7 @@
     },
     },
     "_enabled": true,
     "_enabled": true,
     "__prefab": {
     "__prefab": {
-      "__id__": 241
+      "__id__": 247
     },
     },
     "playOnLoad": true,
     "playOnLoad": true,
     "_clips": [
     "_clips": [
@@ -6005,7 +6188,7 @@
     },
     },
     "_enabled": true,
     "_enabled": true,
     "__prefab": {
     "__prefab": {
-      "__id__": 243
+      "__id__": 249
     },
     },
     "_id": ""
     "_id": ""
   },
   },

+ 57 - 11
assets/script/ui/car_info.ts

@@ -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
+        }
+
     }
     }
 }
 }