36 lines
1.2 KiB
Lua
36 lines
1.2 KiB
Lua
local UnitJoinNone = {}
|
|
local M = UnitJoinNone
|
|
|
|
function UnitJoinNone.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)
|
|
local btnCreateUnit = view:Find("imageUnitHead/btnCreate")
|
|
btnCreateUnit = btnCreateUnit:GetComponent(typeof(UnityEngine.UI.Button))
|
|
LuaUIHelper:AddButtonClick(btnCreateUnit, function()
|
|
UIManager.ShowUI(UIManager.ViewCreateUnit)
|
|
end)
|
|
local btnJoinUnit = view:Find("imageUnitHead/btnJoin")
|
|
btnJoinUnit = btnJoinUnit:GetComponent(typeof(UnityEngine.UI.Button))
|
|
LuaUIHelper:AddButtonClick(btnJoinUnit, function()
|
|
UIManager.ShowUI(UIManager.ViewCreateUnit)
|
|
end)
|
|
local btnCreateTable = view:Find("btnCreate")
|
|
btnCreateTable = btnCreateTable:GetComponent(typeof(UnityEngine.UI.Button))
|
|
LuaUIHelper:AddButtonClick(btnCreateTable, function()
|
|
UIManager.ShowUI(UIManager.ViewCreateCardGame)
|
|
end)
|
|
local btnJoinTable = view:Find("btnJoin")
|
|
btnJoinTable = btnJoinTable:GetComponent(typeof(UnityEngine.UI.Button))
|
|
LuaUIHelper:AddButtonClick(btnJoinTable, function()
|
|
|
|
end)
|
|
end
|
|
|
|
return M
|