65 lines
2.6 KiB
Lua
65 lines
2.6 KiB
Lua
----- 点将台抽卡 宝箱弹窗 -----
|
||
local this = {}
|
||
--传入父脚本模块
|
||
local parent
|
||
--传入特效层级
|
||
local sortingOrder=0
|
||
local lotterySetting=ConfigManager.GetConfig(ConfigName.LotterySetting)
|
||
local specialConfig=ConfigManager.GetConfig(ConfigName.SpecialConfig)
|
||
local itemConfig=ConfigManager.GetConfig(ConfigName.ItemConfig)
|
||
local s --s1 消耗道具 s2消耗数量
|
||
local b --充值数
|
||
|
||
function this:InitComponent(gameObject)
|
||
this.titleText=Util.GetGameObject(gameObject,"TitleText"):GetComponent("Text")
|
||
this.text1=Util.GetGameObject(gameObject,"Body/Text1"):GetComponent("Text")
|
||
this.text2=Util.GetGameObject(gameObject,"Body/Text2"):GetComponent("Text")
|
||
this.text3=Util.GetGameObject(gameObject,"Body/Text3"):GetComponent("Text")
|
||
this.curNum=Util.GetGameObject(gameObject,"Body/CurNum/Text"):GetComponent("Text")
|
||
this.okBtn=Util.GetGameObject(gameObject,"OkBtn")
|
||
end
|
||
|
||
function this:BindEvent()
|
||
Util.AddClick(this.okBtn,function()
|
||
if BagManager.GetItemCountById(94)< tonumber(s) then
|
||
PopupTipPanel.ShowTip("仙缘积分不足!")
|
||
return
|
||
end
|
||
RecruitManager.RecruitRequest(RecruitType.RecruitBox, function(msg)
|
||
UIManager.OpenPanel(UIName.SingleRecruitPanel, msg.drop.Hero[1],RecruitType.RecruitBox,1,{RecruitType.RecruitBox,RecruitType.RecruitBox})
|
||
this.curNum.text=string.format("当前积分:%s",BagManager.GetItemCountById(94))
|
||
parent:ClosePanel()
|
||
end)
|
||
end)
|
||
|
||
end
|
||
|
||
function this:AddListener()
|
||
end
|
||
|
||
function this:RemoveListener()
|
||
end
|
||
|
||
function this:OnShow(_parent,...)
|
||
parent=_parent
|
||
sortingOrder =_parent.sortingOrder
|
||
local args = {...}
|
||
s=lotterySetting[RecruitType.RecruitBox].CostItem[1][2]
|
||
b=tonumber(specialConfig[49].Value)
|
||
this.titleText.text="仙缘汇聚箱"
|
||
this.text1.text=string.format("消耗%s点仙缘积分可以打开一次仙缘汇聚箱,必定获得5星神将,积分获取规则如下:",s)
|
||
this.text2.text="每次普通召唤获得1点仙缘积分\n每次友情召唤获得2点仙缘积分\n每次神将召唤获得20点仙缘积分" --后续改成读表
|
||
this.text3.text="需要充值"..string.format(MoneyUtil.GetMoneyUnitName(),b).."以上才可打开"
|
||
this.curNum.text=string.format("当前积分:%s",BagManager.GetItemCountById(94))
|
||
Util.SetGray(this.okBtn,VipManager.GetChargedNum()<b)
|
||
this.okBtn:GetComponent("Button").interactable=VipManager.GetChargedNum()>=b
|
||
this.text3.gameObject:SetActive(VipManager.GetChargedNum()>=0 and VipManager.GetChargedNum()<b)
|
||
end
|
||
|
||
function this:OnClose()
|
||
end
|
||
|
||
function this:OnDestroy()
|
||
end
|
||
|
||
return this |