刷冲特权添加开启条件

wangzhenxing 2022-11-03 15:46:21 +08:00
parent b32a8c4625
commit 07d9fd4647
1 changed files with 16 additions and 0 deletions

View File

@ -30,6 +30,7 @@ function GMShuaChongTeQuan:InitComponent()
self.grid = Util.GetGameObject(self.gameObject, "grid")
self.titleImg=Util.GetGameObject(self.gameObject, "bg1/shenzuntequanName"):GetComponent("Image")
self.btn_buy=Util.GetGameObject(self.gameObject, "bg1/bg2/btn_buy")
self.hintTxt=Util.GetGameObject(self.gameObject, "bg1/bg2/hintTxt"):GetComponent("Text")
self.tabBox = Util.GetGameObject(self.gameObject, "TabBox")
self.infoGrid=Util.GetGameObject(self.gameObject, "bg1/bg2/info/tequan")
self.infoPre=Util.GetGameObject(self.gameObject, "bg1/bg2/tequanText")
@ -64,6 +65,21 @@ function GMShuaChongTeQuan:InitComponent()
elseif state==2 then
self.payTxt.text="已领取"
end
if _index>1 then
local lastId=_TabData[_index-1].id
local lastmiss=ActivityGiftManager.GetActivityInfo(ActivityTypeDef.shuaChongTeQuan,lastId)
local lastState=lastmiss.state
if lastState==0 then
self.btn_buy:SetActive(false)
self.hintTxt.gameObject:SetActive(true)
self.hintTxt.text="开通".._TabData[_index-1].name.."解锁购买"
else
self.btn_buy:SetActive(true)
self.hintTxt.gameObject:SetActive(false)
end
else
self.hintTxt.gameObject:SetActive(false)
end
Util.AddOnceClick(self.btn_buy,function()
if state==0 then
PayManager.Pay(recharge.Id, function()