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,40 @@
|
||||
local ____exports = __module.env
|
||||
local M__framework_context_game_context = __MODULE__.Import("framework.context.game_context", __module)
|
||||
local GetGameInstanceContext = M__framework_context_game_context.GetGameInstanceContext
|
||||
local M__game_startup = __MODULE__.Import("game.startup", __module)
|
||||
local OpenMiniSettings = M__game_startup.OpenMiniSettings
|
||||
--- PIE / 启动地图玩家入口:绑定 LocalPlayer(0) 的 PlayerController 并打开首期最小设置窗口。
|
||||
function ____exports.OnBeginPlay(pc)
|
||||
local world = pc:GetWorld()
|
||||
local gi = UE.UGameplayStatics.GetGameInstance(pc)
|
||||
if gi == nil then
|
||||
return
|
||||
end
|
||||
local ctx = GetGameInstanceContext(gi)
|
||||
if ctx == nil then
|
||||
return
|
||||
end
|
||||
if world ~= nil and ctx:GetWorldContext().world ~= world then
|
||||
ctx:OnWorldCleanup(world)
|
||||
end
|
||||
ctx:GetOrCreateLocalPlayer(0, pc)
|
||||
OpenMiniSettings(ctx)
|
||||
end
|
||||
function ____exports.OnEndPlay(pc, _endPlayReason)
|
||||
local gi = UE.UGameplayStatics.GetGameInstance(pc)
|
||||
if gi == nil then
|
||||
return
|
||||
end
|
||||
local ctx = GetGameInstanceContext(gi)
|
||||
if ctx == nil then
|
||||
return
|
||||
end
|
||||
local lp = ctx:GetOrCreateLocalPlayer(0)
|
||||
if lp.playerController == pc then
|
||||
lp.playerController = nil
|
||||
end
|
||||
end
|
||||
function __module.UpdateImports()
|
||||
GetGameInstanceContext = M__framework_context_game_context.GetGameInstanceContext
|
||||
OpenMiniSettings = M__game_startup.OpenMiniSettings
|
||||
end
|
||||
Reference in new issue
Block a user