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:
szy73711 committed 2026-11-30 02:42:51 +08:00
1 parent 4ad4a8f36f
commit 783dccf53d
64 files changed
+2368 -714

No files matched your search

+34 -6
View File
@@ -1,7 +1,7 @@
local ____exports = {}
local Log = require("Framework.Log")
local EventBus = require("Framework.EventBus")
local HotReload = require("Framework.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.Shutdown()
Log.Info("Lua GameFramework shutting down...")
EventBus.Clear()
@@ -9,8 +9,12 @@ function ____exports.Shutdown()
____exports.IsInitialized = false
_G.GameFramework = nil
end
____exports.Version = "0.1.0"
____exports.Version = "0.2.0"
---
-- @module_data
____exports.IsInitialized = false
---
-- @module_data
____exports.GameInstance = nil
function ____exports.Init(gameInstance)
____exports.GameInstance = gameInstance
@@ -24,4 +28,28 @@ function ____exports.Init(gameInstance)
}
Log.Info("Lua GameFramework initialized (version=%s, Lua=%s)", ____exports.Version, _VERSION)
end
return ____exports
function __module.StashData(env, to)
local ____has = to.__has__
if not ____has then
____has = {}
to.__has__ = ____has
end
to.IsInitialized = ____exports.IsInitialized
____has.IsInitialized = true
to.GameInstance = ____exports.GameInstance
____has.GameInstance = true
end
function __module.RestoreData(env, from)
local ____has = from.__has__
if not ____has then
return
end
if ____has.IsInitialized then
____exports.IsInitialized = from.IsInitialized
end
if ____has.GameInstance then
____exports.GameInstance = from.GameInstance
end
end
function __module.UpdateImports()
end