-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBP_TestController.lua
49 lines (38 loc) · 1.21 KB
/
BP_TestController.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
--
-- DESCRIPTION
--
-- @COMPANY **
-- @AUTHOR **
-- @DATE ${date} ${time}
--
---@type BP_TestController_C
local M = UnLua.Class()
local BindKey = UnLua.Input.BindKey
-- function M:Initialize(Initializer)
-- end
-- function M:UserConstructionScript()
-- end
function M:ReceiveBeginPlay()
self.pausemenu_root = UE.UClass.Load("/Game/TestFile/UserWidget/WBP_PauseMenu.WBP_PauseMenu_C")
self.pausemenu_class = NewObject(self.pausemenu_root, self)
self.pausemenu_class:AddToViewport()
self.pausemenu_class:SetVisibility(UE.ESlateVisibility.Collapsed)
self.controller = UE.UGameplayStatics.GetPlayerController(self:GetWorld(),0)
end
BindKey(M, "M", "Pressed", function(self, key)
self.pausemenu_class:SetVisibility(UE.ESlateVisibility.Visible)
UE.UGameplayStatics.SetGamePaused(self:GetWorld(),true)
self.controller.bShowMouseCursor = true
UE.UWidgetBlueprintLibrary.SetInputMode_GameAndUI(self.controller)
end)
-- function M:ReceiveEndPlay()
-- end
-- function M:ReceiveTick(DeltaSeconds)
-- end
-- function M:ReceiveAnyDamage(Damage, DamageType, InstigatedBy, DamageCauser)
-- end
-- function M:ReceiveActorBeginOverlap(OtherActor)
-- end
-- function M:ReceiveActorEndOverlap(OtherActor)
-- end
return M