|
@@ -1,5 +1,6 @@
|
|
|
import { _decorator, Component, Node, profiler, SpriteComponent, LabelComponent, ButtonComponent, loader, SpriteFrame } from 'cc';
|
|
|
import GameConfigManager from '../../models/GameConfigManager';
|
|
|
+import { GameModel } from '../../models/GameModel';
|
|
|
const { ccclass, property } = _decorator;
|
|
|
|
|
|
@ccclass('ShopItemRenderScript')
|
|
@@ -25,11 +26,21 @@ export class ShopItemRenderScript extends Component {
|
|
|
})
|
|
|
freeBuyButton:ButtonComponent=null;
|
|
|
|
|
|
+ @property({
|
|
|
+ type:LabelComponent
|
|
|
+ })
|
|
|
+ freeBuyButtonLabel:LabelComponent=null;
|
|
|
+
|
|
|
@property({
|
|
|
type:ButtonComponent
|
|
|
})
|
|
|
diamondBuyButton:ButtonComponent=null;
|
|
|
|
|
|
+ @property({
|
|
|
+ type:LabelComponent
|
|
|
+ })
|
|
|
+ diamondBuyButtonLabel:LabelComponent=null;
|
|
|
+
|
|
|
|
|
|
@property({
|
|
|
type:ButtonComponent
|
|
@@ -74,9 +85,11 @@ export class ShopItemRenderScript extends Component {
|
|
|
if(this.data.buyType==0){//金币购买
|
|
|
this.freeBuyButton.node.active=this.diamondBuyButton.node.active=false;
|
|
|
this.GlodBuyButton.node.active=true;
|
|
|
+ this.freeBuyButtonLabel.string=GameModel.single.GetWeaponBuyPrice(this.data.id).toString();
|
|
|
}else if(this.data.buyType==1){//宝石购买
|
|
|
this.freeBuyButton.node.active=this.GlodBuyButton.node.active=false;
|
|
|
this.diamondBuyButton.node.active=true;
|
|
|
+ this.diamondBuyButtonLabel.string=weaponConfig.consumeDiamond.toString();
|
|
|
}else{//广告购买
|
|
|
this.diamondBuyButton.node.active=this.GlodBuyButton.node.active=false;
|
|
|
this.freeBuyButton.node.active=true;
|