36 lines
1.2 KiB
Lua
36 lines
1.2 KiB
Lua
function LoadInitTable()
|
|
---@type table<int32, AActor>
|
|
local AllInitStarts = {};
|
|
UE.FindActorsByClass(ObjectPath.BP_ActorStart, AllInitStarts);
|
|
local NoTagActors = {};
|
|
local TagActors = {};
|
|
for i, Start in pairs(AllInitStarts) do
|
|
if Start.Tags:Num() > 0 then
|
|
for Tag, Obj in pairs(InitTable) do
|
|
if Start:ActorHasTag(Tag) then
|
|
-- 在此创建一个
|
|
if TagActors[Tag] == nil then TagActors[Tag] = {}; end
|
|
table.insert(TagActors[Tag], Start);
|
|
-- 直接生成
|
|
ObjectPath.AddFunc(Obj, function(TargetClass)
|
|
local Actor = UE.SpawnActor(TargetClass, GameState, VectorHelper.Add(Start:K2_GetActorLocation(), VectorHelper.MakeVector(0, 0, 50)));;
|
|
if InitTableActors[Tag] == nil then InitTableActors[Tag] = {}; end
|
|
table.insert(InitTableActors[Tag], Actor);
|
|
end);
|
|
end
|
|
end
|
|
else
|
|
table.insert(NoTagActors, Start);
|
|
end
|
|
end
|
|
|
|
UGCLogSystem.LogTree(string.format("[LoadInitTable] TagActors ="), TagActors)
|
|
UGCLogSystem.LogTree(string.format("[LoadInitTable] NoTagActors ="), NoTagActors)
|
|
UGCLogSystem.LogTree(string.format("[LoadInitTable] InitTableActors ="), InitTableActors);
|
|
end
|
|
|
|
InitTable = {
|
|
['Hold'] = "BP_HoldPoint",
|
|
};
|
|
|
|
InitTableActors = {}; |