Files
UnrealLuaDemo/Content/Script/Game/LuaPlayerController.lua
T

26 lines
792 B
Lua
Raw Normal View History

---@type LuaPlayerController
local M = UnLua.Class()
local Log = require("Framework.Log")
local EventBus = require("Framework.EventBus")
local HotReload = require("Framework.HotReload")
function M:ReceiveBeginPlay()
Log.Info("LuaPlayerController:ReceiveBeginPlay() - Ready for [Space]=Ping, [R]=HotReload")
end
function M:OnDemoPingPressed()
Log.Info("LuaPlayerController:OnDemoPingPressed() -> Emitting Demo.Ping")
EventBus.Emit("Demo.Ping", "LuaPlayerController")
end
function M:OnDemoHotReloadPressed()
Log.Info("LuaPlayerController:OnDemoHotReloadPressed() -> Triggering HotReload.ReloadAll()")
HotReload.ReloadAll()
end
function M:ReceiveEndPlay(EndPlayReason)
Log.Info("LuaPlayerController:ReceiveEndPlay(reason=%s)", tostring(EndPlayReason))
end
return M