2020-08-25 15:46:38 +08:00
|
|
|
|
----- 献祭弹窗 -----
|
2020-06-03 19:09:01 +08:00
|
|
|
|
local this = {}
|
|
|
|
|
--传入父脚本模块
|
|
|
|
|
local parent
|
|
|
|
|
--传入特效层级
|
|
|
|
|
local sortingOrder=0
|
|
|
|
|
local fun
|
|
|
|
|
local itemList = {}
|
|
|
|
|
local oldLevelId = 0
|
|
|
|
|
local curLevelId = 0
|
|
|
|
|
--传入选择英雄
|
|
|
|
|
local itemConfig=ConfigManager.GetConfig(ConfigName.ItemConfig)
|
|
|
|
|
this.timer = Timer.New()
|
|
|
|
|
function this:InitComponent(gameObject)
|
|
|
|
|
this.backBtn=Util.GetGameObject(gameObject,"bg/backBtn")
|
|
|
|
|
this.Root=Util.GetGameObject(gameObject,"Root")
|
|
|
|
|
this.proPre=Util.GetGameObject(gameObject,"proPre")
|
|
|
|
|
itemList = {}
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function this:BindEvent()
|
|
|
|
|
Util.AddClick(this.backBtn,function()
|
|
|
|
|
parent:ClosePanel()
|
|
|
|
|
end)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function this:AddListener()
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function this:RemoveListener()
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function this:OnShow(_parent,...)
|
|
|
|
|
FightPointPassManager.SetIsOpenRewardUpTip(false)
|
|
|
|
|
parent=_parent
|
|
|
|
|
sortingOrder = _parent.sortingOrder
|
|
|
|
|
--不定参中包含的不定参 _args[1]为面板类型 _args[2]之后(包括)为打开面板后传入的不定参
|
|
|
|
|
local _args = {...}
|
|
|
|
|
fun = _args[1]
|
|
|
|
|
--LogGreen("FightPointPassManager.lastPassFightId "..FightPointPassManager.lastPassFightId .. " " .. FightPointPassManager.curOpenFight)
|
|
|
|
|
oldLevelId = FightPointPassManager.lastPassFightId
|
|
|
|
|
curLevelId = FightPointPassManager.curOpenFight
|
|
|
|
|
local oldLevelConFig = ConfigManager.GetConfigData(ConfigName.MainLevelConfig,oldLevelId)
|
|
|
|
|
local curLevelConFig = ConfigManager.GetConfigData(ConfigName.MainLevelConfig,curLevelId)
|
|
|
|
|
--itemList
|
|
|
|
|
if curLevelConFig then
|
|
|
|
|
for i = 1, math.max(#itemList, #curLevelConFig.RewardShowMin) do
|
|
|
|
|
local go = itemList[i]
|
|
|
|
|
if not go then
|
|
|
|
|
go = newObject(this.proPre)
|
|
|
|
|
go.transform:SetParent(this.Root.transform)
|
|
|
|
|
go.transform.localScale = Vector3.one
|
|
|
|
|
go.transform.localPosition = Vector3.zero
|
|
|
|
|
itemList[i] = go
|
|
|
|
|
end
|
|
|
|
|
go.gameObject:SetActive(false)
|
|
|
|
|
end
|
|
|
|
|
for i = 1, #curLevelConFig.RewardShowMin do
|
|
|
|
|
local go = itemList[i]
|
|
|
|
|
local oldsinglePro = oldLevelConFig.RewardShowMin[i]
|
|
|
|
|
local cursinglePro = curLevelConFig.RewardShowMin[i]
|
|
|
|
|
go.gameObject:SetActive(true)
|
|
|
|
|
Util.GetGameObject(go,"Image"):GetComponent("Image").sprite = SetIcon(cursinglePro[1])
|
2021-01-26 17:08:39 +08:00
|
|
|
|
Util.GetGameObject(go, "proName"):GetComponent("Text").text = GetLanguageStrById(itemConfig[cursinglePro[1]].Name)
|
2020-06-03 19:09:01 +08:00
|
|
|
|
Util.GetGameObject(go, "proValue"):GetComponent("Text").text = oldsinglePro[2]
|
2020-06-08 20:18:49 +08:00
|
|
|
|
if cursinglePro[2] - oldsinglePro[2] > 0 then
|
2021-04-06 22:33:57 +08:00
|
|
|
|
Util.GetGameObject(go, "nextproValue"):GetComponent("Text").text = "<color=#529864>"..cursinglePro[2].."</color>"..Language[11567]
|
2020-06-08 20:18:49 +08:00
|
|
|
|
else
|
2021-04-06 22:33:57 +08:00
|
|
|
|
Util.GetGameObject(go, "nextproValue"):GetComponent("Text").text = "<color=#C8AD83>"..cursinglePro[2]..Language[11568]
|
2020-06-08 20:18:49 +08:00
|
|
|
|
end
|
2020-06-03 19:09:01 +08:00
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
if this.timer then
|
|
|
|
|
this.timer:Stop()
|
|
|
|
|
this.timer = nil
|
|
|
|
|
end
|
|
|
|
|
this.timer = Timer.New(function()
|
|
|
|
|
parent:ClosePanel()
|
2020-06-08 13:57:30 +08:00
|
|
|
|
end,2):Start()
|
2020-06-03 19:09:01 +08:00
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function this:OnClose()
|
|
|
|
|
if this.timer then
|
|
|
|
|
this.timer:Stop()
|
|
|
|
|
this.timer = nil
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function this:OnDestroy()
|
|
|
|
|
itemList = {}
|
|
|
|
|
if this.timer then
|
|
|
|
|
this.timer:Stop()
|
|
|
|
|
this.timer = nil
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
2020-06-23 18:36:24 +08:00
|
|
|
|
return this
|