添加最大购买上限

yuanshuai 2022-11-03 17:47:34 +08:00
parent f697f7893b
commit d3194dba53
1 changed files with 3 additions and 0 deletions

View File

@ -44,6 +44,9 @@ function this:BindEvent()
local maxCostNum=maxExchangeNum*onecostnum
local costNum=maxCostNum>haveNum and haveNum or maxCostNum
this.exchangeNum=math.floor(costNum/onecostnum)
if this.exchangeNum>999 then
this.exchangeNum=999
end
this.changeNumText.text=this.exchangeNum
this.costNum.text=this.exchangeNum*onecostnum
end)