2026-11-30 02:42:51 +08:00
|
|
|
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)
|
2026-11-29 03:08:03 +08:00
|
|
|
function ____exports.Shutdown()
|
|
|
|
|
Log.Info("Lua GameFramework shutting down...")
|
|
|
|
|
EventBus.Clear()
|
|
|
|
|
____exports.GameInstance = nil
|
|
|
|
|
____exports.IsInitialized = false
|
|
|
|
|
_G.GameFramework = nil
|
|
|
|
|
end
|
2026-11-30 02:42:51 +08:00
|
|
|
____exports.Version = "0.2.0"
|
|
|
|
|
---
|
|
|
|
|
-- @module_data
|
2026-11-29 03:08:03 +08:00
|
|
|
____exports.IsInitialized = false
|
2026-11-30 02:42:51 +08:00
|
|
|
---
|
|
|
|
|
-- @module_data
|
2026-11-29 03:08:03 +08:00
|
|
|
____exports.GameInstance = nil
|
|
|
|
|
function ____exports.Init(gameInstance)
|
|
|
|
|
____exports.GameInstance = gameInstance
|
|
|
|
|
____exports.IsInitialized = true
|
2026-11-28 01:45:03 +08:00
|
|
|
_G.GameFramework = {
|
|
|
|
|
Log = Log,
|
|
|
|
|
EventBus = EventBus,
|
|
|
|
|
HotReload = HotReload,
|
2026-11-29 03:08:03 +08:00
|
|
|
Bootstrap = {Version = ____exports.Version, Init = ____exports.Init, Shutdown = ____exports.Shutdown},
|
|
|
|
|
GameInstance = gameInstance
|
2026-11-28 01:45:03 +08:00
|
|
|
}
|
2026-11-29 03:08:03 +08:00
|
|
|
Log.Info("Lua GameFramework initialized (version=%s, Lua=%s)", ____exports.Version, _VERSION)
|
2026-11-28 01:45:03 +08:00
|
|
|
end
|
2026-11-30 02:42:51 +08:00
|
|
|
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
|