panhui hace 2 años
padre
commit
11b6e2a600
Se han modificado 2 ficheros con 170 adiciones y 2151 borrados
  1. 149 2133
      assets/scence/game.scene
  2. 21 18
      assets/scripts/rankCtr.ts

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 149 - 2133
assets/scence/game.scene


+ 21 - 18
assets/scripts/rankCtr.ts

@@ -55,24 +55,27 @@ export class rankCtr extends Component {
     updateRank(data: any[]) {
         if (this.rankNodes.length === 0) {
             this.rankList = data
-            data.forEach((item, index) => {
-                let node = instantiate(this.gameItem)
-
-                let number = node.getChildByName("text_rank_number").getComponent(Label)
-                number.string = index + 1
-
-                let nickName = node.getChildByName("text_player_name").getComponent(Label)
-                nickName.string = item.userInfo.name
-
-                let days = node.getChildByName("text_value").getComponent(Label)
-                if (this.lng === "cn") {
-                    days.string = item.survival + "天"
-                } else {
-                    days.string = item.survival + (item.survival == "1" ? "day" : "days")
-                }
-                this.content.addChild(node)
-                this.rankNodes.push(node)
-            })
+            if(data.length>0){
+
+                data.forEach((item, index) => {
+                    let node = instantiate(this.gameItem)
+    
+                    let number = node.getChildByName("text_rank_number").getComponent(Label)
+                    number.string = index + 1
+    
+                    let nickName = node.getChildByName("text_player_name").getComponent(Label)
+                    nickName.string = item.userInfo.name
+    
+                    let days = node.getChildByName("text_value").getComponent(Label)
+                    if (this.lng === "cn") {
+                        days.string = item.survival + "天"
+                    } else {
+                        days.string = item.survival + (item.survival == "1" ? "day" : "days")
+                    }
+                    this.content.addChild(node)
+                    this.rankNodes.push(node)
+                })
+            }
             // 数据变化开启动画
             // if (this.startAnimate) {
             //     setTimeout(() => {

Algunos archivos no se mostraron porque demasiados archivos cambiaron en este cambio