开始接入厨房
This commit is contained in:
23
Content/Lua/Utils/UI/WidgetUtils.lua
Normal file
23
Content/Lua/Utils/UI/WidgetUtils.lua
Normal file
@ -0,0 +1,23 @@
|
||||
local GameplayStatics = import("GameplayStatics")
|
||||
local WidgetUtils = {}
|
||||
|
||||
local function GetHud(wco)
|
||||
local pc = GameplayStatics.GetPlayerController(wco, 0)
|
||||
if pc == nil then return end
|
||||
return pc:GetHud()
|
||||
end
|
||||
|
||||
function WidgetUtils.Show(wco, widget_name)
|
||||
local hud = GetHud(wco)
|
||||
if not hud then return end
|
||||
return hud:ShowWidget(widget_name)
|
||||
end
|
||||
|
||||
function WidgetUtils.Hide(wco, widget_name)
|
||||
local hud = GetHud(wco)
|
||||
if not hud then return end
|
||||
return hud:PopWidget(widget_name)
|
||||
end
|
||||
|
||||
|
||||
return WidgetUtils
|
||||
Reference in New Issue
Block a user