商店商品++
This commit is contained in:
@@ -41,21 +41,23 @@ export class GoodsComp extends Component {
|
||||
}
|
||||
private update_btn( ){
|
||||
if(smc.shop.goods_count[this.goods_count_key]<=0){
|
||||
this.node.getChildByName("ad").active=false
|
||||
this.node.getChildByName("free").active=false
|
||||
this.node.getChildByName("cast").active=false
|
||||
this.node.getChildByName("nothing").active=true
|
||||
this.node.getChildByName("btn").getChildByName("ad").active=false
|
||||
this.node.getChildByName("btn").getChildByName("free").active=false
|
||||
this.node.getChildByName("btn").getChildByName("diamond").active=false
|
||||
this.node.getChildByName("btn").getChildByName("gold").active=false
|
||||
this.node.getChildByName("btn").getChildByName("nothing").active=true
|
||||
this.node.getChildByName("btn").getComponent(Sprite).grayscale=true
|
||||
return
|
||||
}
|
||||
this.node.getChildByName("nothing").active=false
|
||||
this.node.getChildByName("btn").getChildByName("nothing").active=false
|
||||
this.node.getChildByName("btn").getComponent(Sprite).grayscale=false
|
||||
this.node.getChildByName("ad").active=this.goodsData.c_type==CType.AD
|
||||
this.node.getChildByName("free").active=this.goodsData.c_type==CType.FREE
|
||||
this.node.getChildByName("cast").active=this.goodsData.c_type==(CType.DIAMOND||CType.GOLD)
|
||||
this.node.getChildByName("cast").getChildByName("diamond").active=this.goodsData.c_type==CType.DIAMOND
|
||||
this.node.getChildByName("cast").getChildByName("gold").active=this.goodsData.c_type==CType.GOLD
|
||||
this.node.getChildByName("cast").getChildByName("num").getComponent(Label).string=NumberFormatter.formatNumber(this.goodsData.cast)
|
||||
this.node.getChildByName("btn").getChildByName("ad").active=this.goodsData.c_type==CType.AD
|
||||
this.node.getChildByName("btn").getChildByName("free").active=this.goodsData.c_type==CType.FREE
|
||||
this.node.getChildByName("btn").getChildByName("diamond").getChildByName("num").getComponent(Label).string=NumberFormatter.formatNumber(this.goodsData.cast)
|
||||
this.node.getChildByName("btn").getChildByName("gold").getChildByName("num").getComponent(Label).string=NumberFormatter.formatNumber(this.goodsData.cast)
|
||||
this.node.getChildByName("btn").getChildByName("diamond").active=this.goodsData.c_type==CType.DIAMOND
|
||||
this.node.getChildByName("btn").getChildByName("gold").active=this.goodsData.c_type==CType.GOLD
|
||||
|
||||
}
|
||||
/**
|
||||
* 更新图标
|
||||
|
||||
Reference in New Issue
Block a user