29 lines
735 B
Lua
29 lines
735 B
Lua
local UnitJoinTable = {}
|
|
local M = UnitJoinTable
|
|
|
|
function UnitJoinTable.new(path, transform)
|
|
local self = setmetatable({}, { __index = M })
|
|
self.view = UIManager.GetGo(path, transform)
|
|
self:init(self.view.transform)
|
|
|
|
return self
|
|
end
|
|
|
|
function M:init(view)
|
|
self.bg = view:Find("btnBG")
|
|
self.bg = self.bg:GetComponent(typeof(UnityEngine.UI.Button))
|
|
|
|
LuaUIHelper:AddButtonClick(self.bg, function()
|
|
local open = { [1] = self.LobbyUnit.Main }
|
|
local close = {
|
|
[1] = self.LobbyUnit.List,
|
|
[2] = self.LobbyUnit.JoinNone,
|
|
[3] = self.LobbyUnit.JoinTable,
|
|
[4] = self.LobbyUnit.JoinUnit
|
|
}
|
|
self.CallBack(open, close)
|
|
end)
|
|
end
|
|
|
|
return M
|