yu 3 年之前
父节点
当前提交
132f1a9cee
共有 1 个文件被更改,包括 8 次插入5 次删除
  1. 8 5
      assets/Script/UI/BuildingView.js

+ 8 - 5
assets/Script/UI/BuildingView.js

@@ -147,13 +147,16 @@ cc.Class({
             // console.log(this.mySeedList, this.myFruitList);
             for (let i = 0; i < this.mySeedList.length; i++) {
                 //没有种子数量不显示 todo 看看后续需不需要处理删除
-                if (this.mySeedList[i].amount < 1) continue;
-
+                //if (this.mySeedList[i].amount < 1) continue;
+                
                 let _seed = cc.instantiate(this.seedPrefab);
                 _seed.parent = this.Seed;
-                // if(0 == i){
-                //     this.Building40 = _seed;
-                // }
+               
+                if (this.mySeedList[i].amount == 0)
+                {
+                    _seed.getChildByName("SellOut").active = 0;
+                }
+
                 let _seedScript = _seed.getComponent("Content_Button");
                 _seedScript.Name = this.mySeedList[i].name;
                 _seedScript.Price = 0;