feat: upgrade to ts2lua-unreal v0.3.0 and refactor Game classes to pure C++ callback + TS composition hot-reload
This commit is contained in:
1 parent
4ad4a8f36f
commit
783dccf53d
64 files changed
+2368
-714
No files matched your search
@@ -1,22 +1,23 @@
|
||||
local Log = require("Framework.Log")
|
||||
local EventBus = require("Framework.EventBus")
|
||||
local HotReload = require("Framework.HotReload")
|
||||
local LuaPlayerController = UnLua.Class()
|
||||
function LuaPlayerController.ReceiveBeginPlay(self)
|
||||
Log.Info("LuaPlayerController:ReceiveBeginPlay() - Ready for [Space]=Ping, [R]=HotReload")
|
||||
local ____exports = __module.env
|
||||
local Log = __MODULE__.Import("Framework.Log", __module)
|
||||
local EventBus = __MODULE__.Import("Framework.EventBus", __module)
|
||||
local HotReload = __MODULE__.Import("Framework.HotReload", __module)
|
||||
function ____exports.OnBeginPlay(_pc)
|
||||
Log.Info("LuaPlayerController.OnBeginPlay() - Ready for [Space]=Ping, [R]=HotReload")
|
||||
end
|
||||
function LuaPlayerController.OnDemoPingPressed(self)
|
||||
Log.Info("LuaPlayerController:OnDemoPingPressed() -> Emitting Demo.Ping")
|
||||
function ____exports.OnDemoPingPressed(_pc)
|
||||
Log.Info("LuaPlayerController.OnDemoPingPressed() -> Emitting Demo.Ping")
|
||||
EventBus.Emit("Demo.Ping", "LuaPlayerController")
|
||||
end
|
||||
function LuaPlayerController.OnDemoHotReloadPressed(self)
|
||||
Log.Info("LuaPlayerController:OnDemoHotReloadPressed() -> Triggering HotReload.ReloadAll()")
|
||||
function ____exports.OnDemoHotReloadPressed(_pc)
|
||||
Log.Info("LuaPlayerController.OnDemoHotReloadPressed() -> Triggering HotReload.ReloadAll()")
|
||||
HotReload.ReloadAll()
|
||||
end
|
||||
function LuaPlayerController.ReceiveEndPlay(self, EndPlayReason)
|
||||
function ____exports.OnEndPlay(_pc, endPlayReason)
|
||||
Log.Info(
|
||||
"LuaPlayerController:ReceiveEndPlay(reason=%s)",
|
||||
tostring(EndPlayReason)
|
||||
"LuaPlayerController.OnEndPlay(reason=%s)",
|
||||
tostring(endPlayReason)
|
||||
)
|
||||
end
|
||||
return LuaPlayerController
|
||||
function __module.UpdateImports()
|
||||
end
|
||||
Reference in new issue
Block a user