miduo_client/Assets/ManagedResources/~Lua/Modules/Popup/View/GeneralPopup_TrialGain.lua

85 lines
2.1 KiB
Lua
Raw Normal View History

2020-06-08 20:18:49 +08:00
----- 试练增益弹窗 -----
local this = {}
--传入父脚本模块
local parent
--传入特效层级
local sortingOrder=0
local itemConfig=ConfigManager.GetConfig(ConfigName.ItemConfig)
--增益弹窗类型
local gainType={
Normal=0, --普通查看
Specil=1 --重置时查看
}
--预设容器
local preList={}
function this:InitComponent(gameObject)
this.titleText=Util.GetGameObject(gameObject,"TitleText"):GetComponent("Text")
this.upTip=Util.GetGameObject(gameObject,"UpTip"):GetComponent("Text")
this.bottomTip=Util.GetGameObject(gameObject,"BottomTip"):GetComponent("Text")
this.root=Util.GetGameObject(gameObject,"Root")
this.pre=Util.GetGameObject(this.root,"Pre")
this.goBtn=Util.GetGameObject(gameObject,"GoBtn")
end
function this:BindEvent()
--取消按钮
Util.AddClick(this.cancelBtn,function()
parent:ClosePanel()
end)
end
function this:AddListener()
end
function this:RemoveListener()
end
function this:OnShow(_parent,...)
parent=_parent
sortingOrder = _parent.sortingOrder
--不定参中包含的不定参 _args[1]为面板类型 _args[2]之后(包括)为打开面板后传入的不定参
local _args = {...}
this.RefreshPanel(_args[1])
end
function this:OnClose()
end
function this:OnDestroy()
preList={}
end
--刷新面板
function this.RefreshPanel(type)
this.titleText.text="幻境增益"
this.upTip.gameObject:SetActive(type==gainType.Specil)
this.bottomTip.gameObject:SetActive(type==gainType.Normal)
this.goBtn.gameObject:SetActive(type==gainType.Specil)
local d={1,2,3}
LogPink(LengthOfTable(MapTrialManager.GetBuffList()))
for i, v in ipairs(d) do
local o=preList[i]
if not o then
o=newObjToParent(this.pre,this.root)
o.name="Pre"..i
preList[i]=o
end
local icon=Util.GetGameObject(o,"Icon"):GetComponent("Image")
local tip=Util.GetGameObject(o,"Tip"):GetComponent("Text")
-- icon.sprite=Util.LoadSprite()
tip.text=string.format("%s加成%s","攻击","66")
end
end
return this