83 lines
2.6 KiB
Lua
83 lines
2.6 KiB
Lua
----- 新副本战斗回放弹窗 -----
|
|
local this = {}
|
|
--传入父脚本模块
|
|
local parent
|
|
--传入特效层级
|
|
local sortingOrder=0
|
|
local fun
|
|
local fightLevelId = 0
|
|
local prbGoGrid = {}
|
|
function this:InitComponent(gameObject)
|
|
-- this.titleText=Util.GetGameObject(gameObject,"TitleText"):GetComponent("Text")
|
|
-- this.backBtn=Util.GetGameObject(gameObject,"BackBtn")
|
|
-- prbGoGrid = {}
|
|
-- for i = 1, 2 do
|
|
-- prbGoGrid[i] = Util.GetGameObject(gameObject,"rect/ItemPre (" .. i .. ")")
|
|
-- end
|
|
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,...)
|
|
-- parent=_parent
|
|
-- sortingOrder = _parent.sortingOrder
|
|
-- --不定参中包含的不定参 _args[1]为面板类型 _args[2]之后(包括)为打开面板后传入的不定参
|
|
-- local args = {...}
|
|
-- fightLevelId = args[1]
|
|
-- this.titleText.text="战斗回放"
|
|
-- for i = 1, 2 do
|
|
-- prbGoGrid[i]:SetActive(false)
|
|
-- end
|
|
-- NetManager.HeroNodeGetInfoRequest(monsterData.sortId,function (msg)
|
|
-- for i = 1, 2 do
|
|
-- local data = {}
|
|
-- local root = prbGoGrid[i]
|
|
-- this.SetInfo(root,data)
|
|
-- end
|
|
-- end)
|
|
end
|
|
--设置头像
|
|
function this.SetInfo(root,data,index)
|
|
root:SetActive(true)
|
|
--头像
|
|
local headObj=Util.GetGameObject(root,"HeadParent")
|
|
if not this.playerScrollHead[root] then
|
|
this.playerScrollHead[root]=CommonPool.CreateNode(POOL_ITEM_TYPE.PLAYER_HEAD,headObj)
|
|
end
|
|
this.playerScrollHead[root]:Reset()
|
|
this.playerScrollHead[root]:SetHead(data.head)
|
|
this.playerScrollHead[root]:SetFrame(data.frame)
|
|
this.playerScrollHead[root]:SetLevel(data.level)
|
|
this.playerScrollHead[root]:SetScale(Vector3.one*0.7)
|
|
this.playerScrollHead[root]:SetLayer(this.sortingOrder)
|
|
this.playerScrollHead[root]:SetEffectScale(0.75)
|
|
|
|
Util.GetGameObject(root,"name"):GetComponent("Text").text = data.name
|
|
Util.GetGameObject(root,"warPower/Text"):GetComponent("Text").text = data.warPower
|
|
if index == 1 then
|
|
Util.GetGameObject(root,"ClickBtn/tip"):GetComponent("Text").text = "首次三星通关"
|
|
else
|
|
Util.GetGameObject(root,"ClickBtn/tip"):GetComponent("Text").text = "最低战力三星通关"
|
|
end
|
|
Util.AddOnceClick(Util.GetGameObject(root,"ClickBtn"), function()
|
|
UIManager.OpenPanel(UIName.BattlePanel, fightData, BATTLE_TYPE.BACK, function()
|
|
|
|
end)
|
|
end)
|
|
end
|
|
function this:OnClose()
|
|
|
|
end
|
|
function this:OnDestroy()
|
|
end
|
|
|
|
return this |