45 lines
1.3 KiB
Lua
45 lines
1.3 KiB
Lua
|
---
|
||
|
--- Generated by EmmyLua(https://github.com/EmmyLua)
|
||
|
--- Created by HGX.
|
||
|
--- DateTime: 2024/1/17 20:56
|
||
|
---
|
||
|
|
||
|
local BuffInit_ShowEnemyPos = {};
|
||
|
|
||
|
|
||
|
---@param InType EBuffType Buff 类型
|
||
|
---@return table<int, AActor>
|
||
|
function BuffInit_ShowEnemyPos:Init(InType)
|
||
|
if not UGCGameSystem.IsServer() then
|
||
|
UGCLogSystem.Log("[BuffInit_ShowEnemyPos:Init] 开始执行")
|
||
|
local Actors = {};
|
||
|
|
||
|
-- 多创建几个
|
||
|
for i = 1, 8 do
|
||
|
Actors[#Actors + 1 ] = UGCGameSystem.SpawnActor(UGCGameSystem.GameState, self:GetActorClass(), VectorHelper.VectorZero(), VectorHelper.RotZero(), VectorHelper.ScaleOne());
|
||
|
end
|
||
|
|
||
|
for i, v in pairs(Actors) do
|
||
|
UGCLogSystem.Log("[BuffInit_ShowEnemyPos:Init] Actor Name = %s", UE.GetName(v));
|
||
|
end
|
||
|
|
||
|
if UGCGameSystem.GameState.CachedInit == nil then
|
||
|
UGCGameSystem.GameState.CachedInit = {};
|
||
|
end
|
||
|
-- 只存在服务器
|
||
|
UGCGameSystem.GameState.CachedInit[InType] = Actors;
|
||
|
UGCLogSystem.Log("[BuffInit_ShowEnemyPos:Init] 执行完成")
|
||
|
return Actors;
|
||
|
end
|
||
|
return nil;
|
||
|
end
|
||
|
|
||
|
---@type UClass
|
||
|
function BuffInit_ShowEnemyPos:GetActorClass()
|
||
|
if self.ActorClass == nil then
|
||
|
self.ActorClass = UE.LoadClass(UGCGameSystem.GetUGCResourcesFullPath('Asset/Blueprint/BUFF/BuffAction/ShowEnemyPos/BP_ShowEnemyPos.BP_ShowEnemyPos_C'))
|
||
|
end
|
||
|
return self.ActorClass;
|
||
|
end
|
||
|
|
||
|
return BuffInit_ShowEnemyPos;
|