chore: upgrade ts2lua-unreal to v0.3.1 with lowercase lib/module.lua & lib/class.lua and commit framework refactor
This commit is contained in:
1 parent
783dccf53d
commit
3572f2da43
206 files changed
+14442
-13186
No files matched your search
@@ -0,0 +1,39 @@
|
||||
local ____exports = __module.env
|
||||
local M__share_base_logger = __MODULE__.Import("share.base.logger", __module)
|
||||
local Logger = M__share_base_logger.Logger
|
||||
local M__framework_context_game_context = __MODULE__.Import("framework.context.game_context", __module)
|
||||
local CreateGameInstanceContext = M__framework_context_game_context.CreateGameInstanceContext
|
||||
local DestroyGameInstanceContext = M__framework_context_game_context.DestroyGameInstanceContext
|
||||
local GetGameInstanceContext = M__framework_context_game_context.GetGameInstanceContext
|
||||
local M__game_startup = __MODULE__.Import("game.startup", __module)
|
||||
local AssembleGameInstanceServices = M__game_startup.AssembleGameInstanceServices
|
||||
local logger = Logger("Main")
|
||||
function ____exports.OnInit(gameInstance)
|
||||
local ctx = CreateGameInstanceContext(gameInstance)
|
||||
AssembleGameInstanceServices(ctx)
|
||||
logger:Info("GameInstance initialized", {contextId = ctx.contextId, luaVersion = _VERSION})
|
||||
return ctx
|
||||
end
|
||||
function ____exports.OnTick(gameInstance, deltaSeconds)
|
||||
local ctx = GetGameInstanceContext(gameInstance)
|
||||
if ctx ~= nil then
|
||||
ctx:Tick(deltaSeconds)
|
||||
end
|
||||
end
|
||||
function ____exports.OnWorldCleanup(gameInstance)
|
||||
local ctx = GetGameInstanceContext(gameInstance)
|
||||
if ctx ~= nil then
|
||||
ctx:OnWorldCleanup()
|
||||
end
|
||||
end
|
||||
function ____exports.OnShutdown(gameInstance)
|
||||
logger:Info("GameInstance shutting down")
|
||||
DestroyGameInstanceContext(gameInstance)
|
||||
end
|
||||
function __module.UpdateImports()
|
||||
Logger = M__share_base_logger.Logger
|
||||
CreateGameInstanceContext = M__framework_context_game_context.CreateGameInstanceContext
|
||||
DestroyGameInstanceContext = M__framework_context_game_context.DestroyGameInstanceContext
|
||||
GetGameInstanceContext = M__framework_context_game_context.GetGameInstanceContext
|
||||
AssembleGameInstanceServices = M__game_startup.AssembleGameInstanceServices
|
||||
end
|
||||
Reference in new issue
Block a user