26 lines
592 B
Lua
Raw Permalink Normal View History

2025-01-04 23:00:19 +08:00
--- 检查工具
local CheckTool = {};
--- 检查玩家是否离开
---@param InFunc fun(TeamIDs:table<int32, TeamId>)
function CheckTool:PlayerLeave(InFunc)
local PCs = UGCGameSystem.GetAllPlayerController(false);
-- 检查有多少个 TeamId
local TeamIds = {};
for i, v in pairs(PCs) do
local TeamID = UGCPlayerControllerSystem.GetTeamID(v);
table.insert(TeamIds, TeamID);
end
return InFunc(TeamIds);
end
-- 检查玩家是否存活
function CheckTool:PlayerAlive()
local Pawns = UGCGameSystem.GetAllPlayerPawn();
for i, Pawn in pairs(Pawns) do
end
end
return CheckTool;