42 lines
938 B
Lua
42 lines
938 B
Lua
|
require('Script.Global.GlobalLogic.LogicConfig')
|
||
|
|
||
|
GlobalInit = GlobalInit or {}
|
||
|
|
||
|
function GlobalInit.Init()
|
||
|
GlobalInit.ServerAndClientInit()
|
||
|
if UGCGameSystem.IsServer() then
|
||
|
GlobalInit.ServerInit()
|
||
|
else
|
||
|
GlobalInit.ClientInit()
|
||
|
end
|
||
|
|
||
|
for i, v in pairs(LogicConfig.RequireList) do
|
||
|
local GlobalLogicInst = require(v)
|
||
|
if GlobalLogicInst.Init then
|
||
|
GlobalLogicInst.Init()
|
||
|
end
|
||
|
end
|
||
|
end
|
||
|
|
||
|
function GlobalInit.ServerAndClientInit()
|
||
|
EventManager.InitEventManager()
|
||
|
end
|
||
|
|
||
|
function GlobalInit.ServerInit()
|
||
|
end
|
||
|
|
||
|
function GlobalInit.ClientInit()
|
||
|
end
|
||
|
|
||
|
function GlobalInit.SpawnActorFromPath(AssetClass)
|
||
|
return UGCGameSystem.SpawnActor(
|
||
|
UGCGameSystem.GameState,
|
||
|
AssetClass,
|
||
|
VectorHelper.VectorZero(),
|
||
|
VectorHelper.RotZero(),
|
||
|
VectorHelper.ScaleOne(),
|
||
|
UGCGameSystem.GameState
|
||
|
)
|
||
|
end
|
||
|
|
||
|
return GlobalInit
|