miduo_client/Assets/ManagedResources/~Lua/Modules/GeneralPanel/View/GeneralBigPopup_ShenYingShu...

64 lines
1.8 KiB
Lua

----- 神应属性弹窗 -----
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)
-- attriList = {}
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)
if SacredTreeManager.GetTowerLevel() >= data[i].allNum then
name.text = "<color=#66FF00>"..PropertyConfig[data[i].id].Info..":四灵试炼通关"..data[i].allNum.."层("..data[i].curNum.."/"..data[i].allNum..")</color>"
else
name.text = "<color=#B9AE97>"..PropertyConfig[data[i].id].Info..":四灵试炼通关"..data[i].allNum.."层("..data[i].curNum.."/"..data[i].allNum..")</color>"
end
end
end
function this:OnClose()
end
function this:OnDestroy()
attriList = {}
end
return this