SamsaraGame/assets/Script/panel/BiddingPanel.js
2025-04-24 17:03:28 +08:00

35 lines
621 B
JavaScript

import GameModel from "../ts/core/GameModel";
cc.Class({
extends: cc.Component,
properties: {
txt: cc.Label,
},
start () {
this.curtxt = 1000;
this.step = 1000;
},
onReset(){
this.curtxt = 1000;
this.txt.string = this.curtxt;
},
onAdd(){
this.curtxt += this.step;
if(this.curtxt > 10000){
this.curtxt = 10000;
}
this.txt.string = this.curtxt;
},
onBidding(){
GameModel.send('c2s_bang_bid', {money : this.curtxt});
this.node.active = false;
},
// update (dt) {},
});