----- 神应属性弹窗 -----
local this = {}
local PropertyConfig = ConfigManager.GetConfig(ConfigName.PropertyConfig)
--传入父脚本模块
local parent
local sortingOrder=0
local attriList = {}
function this:InitComponent(gameObject)
self.attriListGrid =Util.GetGameObject(gameObject, "bg/attriListGrid")
self.attriPre =Util.GetGameObject(gameObject, "bg/attriPre")
end
function this:BindEvent()
end
function this:AddListener()
end
function this:RemoveListener()
end
function this:OnShow(_parent)
parent=_parent
sortingOrder = _parent.sortingOrder
parent.BG:SetActive(false)
local curNum = SacredTreeManager.GetTowerLevel()
local data = SacredTreeManager.treeSettingData
for i = 1, #data do
local go = attriList[i]
if not go then
go = newObject(self.attriPre)
go.transform:SetParent(self.attriListGrid.transform)
go.transform.localScale = Vector3.one
go.transform.localPosition = Vector3.zero
attriList[i] = go
end
go.gameObject:SetActive(false)
end
for i = 1, #data do
local go = attriList[i]
go.gameObject:SetActive(true)
local name = Util.GetGameObject(go,"name"):GetComponent("Text")
local num = Util.GetGameObject(go,"num"):GetComponent("Text")
num.gameObject:SetActive(false)
local str = string.format("%s:四灵试炼通关%s层(%s/%s)",PropertyConfig[data[i].id].Info,data[i].allNum,curNum,data[i].allNum)
if SacredTreeManager.GetTowerLevel() >= data[i].allNum then
name.text = ""..str..""
else
name.text = ""..str..""
end
end
end
function this:OnClose()
end
function this:OnDestroy()
attriList = {}
end
return this