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

64 lines
1.8 KiB
Lua
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

----- 神应属性弹窗 -----
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 = "<color=#66FF00>"..str.."</color>"
else
name.text = "<color=#B9AE97>"..str.."</color>"
end
end
end
function this:OnClose()
end
function this:OnDestroy()
attriList = {}
end
return this