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

64 lines
1.8 KiB
Lua
Raw Normal View History

2020-12-11 16:03:27 +08:00
----- 神应属性弹窗 -----
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)
2021-02-26 17:44:13 +08:00
local curNum = SacredTreeManager.GetTowerLevel()
2020-12-11 16:03:27 +08:00
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)
2021-03-10 16:04:26 +08:00
local str = string.format("%s四灵试炼通关%s层(%s/%s)",PropertyConfig[data[i].id].Info,data[i].allNum,curNum,data[i].allNum)
2020-12-21 13:43:04 +08:00
if SacredTreeManager.GetTowerLevel() >= data[i].allNum then
2021-03-10 16:04:26 +08:00
name.text = "<color=#66FF00>"..str.."</color>"
2020-12-11 16:03:27 +08:00
else
2021-03-10 16:04:26 +08:00
name.text = "<color=#B9AE97>"..str.."</color>"
2020-12-11 16:03:27 +08:00
end
end
end
function this:OnClose()
end
function this:OnDestroy()
2020-12-15 17:27:16 +08:00
attriList = {}
2020-12-11 16:03:27 +08:00
end
return this