PGRData/Script/matrix/xui/xuimoewar/childitem/XUiGridGroupList.lua

30 lines
No EOL
1.1 KiB
Lua

local XUiGridGroupList = XClass(nil, "XUiGridGroupList")
local XUiGridPairGroup = require("XUi/XUiMoeWar/ChildItem/XUiGridPairGroup")
local tableInsert = table.insert
function XUiGridGroupList:Ctor(ui, index)
---@type UnityEngine.GameObject
self.GameObject = ui
self.Transform = self.GameObject.transform
self.GroupId = index
---@type XMoeWarMatch
local match = XDataCenter.MoeWarManager.GetCurMatch()
self.GroupConfig = match:GetPlayerListByGroupId(self.GroupId)
XTool.InitUiObject(self)
local activityInfo = XDataCenter.MoeWarManager.GetActivityInfo()
self.TxtFirstTitle.text = activityInfo.GroupName[index]
self.TxtSecondTitle.text = activityInfo.GroupSecondName[index]
self:InitPairList()
end
function XUiGridGroupList:InitPairList()
self.PairList = {}
for i = 1, #self.GroupConfig do
local obj = CS.UnityEngine.GameObject.Instantiate(self.BtnGroup, self.GroupList)
local gird = XUiGridPairGroup.New(obj, self.GroupConfig[i].PlayerId, i)
tableInsert(self.PairList, gird)
end
self.BtnGroup.gameObject:SetActiveEx(false)
end
return XUiGridGroupList