---@class UGCPlayerStartManager_C:BP_PlayerStartManager_C ---@field PlayerStartClass UClass --Edit Below-- ---@type UGCPlayerStartManager_C local UGCPlayerStartManager = {}; ---@type table UGCPlayerStartManager.AllPlayerStarts = {}; function UGCPlayerStartManager:ReceiveBeginPlay() self.SuperClass.ReceiveBeginPlay(self); UGCEventSystem.AddListener(EventTypes.ClientAlready, self.OnMapLoaded, self); GlobalStartManager = self; UGCLogSystem.Log("[UGCPlayerStartManager:ReceiveBeginPlay] 执行") end function UGCPlayerStartManager:LoadAllPlayerStarts() local AllStarts = {}; UE.FindActorsByClass(self.PlayerStartClass, AllStarts); for i, v in pairs(AllStarts) do self.AllPlayerStarts[v.PlayerBornPointID] = v; end UGCLogSystem.LogTree(string.format("[UGCPlayerStartManager:LoadAllPlayerStarts] self.AllPlayerStarts ="), self.AllPlayerStarts) end function UGCPlayerStartManager:OnMapLoaded(LoadedMapIndex, IsLoad) self:LoadAllPlayerStarts(); end ---@param Controller UGCPlayerController_C ---@return BP_STPlayerStart_C function UGCPlayerStartManager:GetUGCModePlayerStart(Controller) if table.isEmpty(self.AllPlayerStarts) then self:LoadAllPlayerStarts() end local PlayerStart = table.func(MiniManager, "SelectPlayerStart", self.AllPlayerStarts, Controller); if PlayerStart and UE.IsValid(PlayerStart) then return PlayerStart; end return self:GetPlayerStart_Internal(Controller); end function UGCPlayerStartManager:GetPlayerStart_Internal(Controller) local PlayerKey = Controller.PlayerKey; if table.isEmpty(self.AllPlayerStarts) then self:LoadAllPlayerStarts() end local TeamId = UGCPlayerStateSystem.GetTeamID(PlayerKey); local RoundTimes = table.func(MiniManager, "GetCurrRoundTimes") UGCLogSystem.Log("[UGCPlayerStartManager:GetPlayerStart_Internal] TeamId = %d", TeamId); UGCLogSystem.LogTree(string.format("[UGCPlayerStartManager:GetPlayerStart_Internal] self.AllPlayerStarts ="), self.AllPlayerStarts) if RoundTimes == nil then return self.AllPlayerStarts[TeamId]; end if RoundTimes % 2 == 1 then return self.AllPlayerStarts[TeamId]; else for i, v in pairs(self.AllPlayerStarts) do if i ~= TeamId then return v; end end end return nil; end --[[ function UGCPlayerStartManager:ReceiveTick(DeltaTime) self.SuperClass.ReceiveTick(self, DeltaTime); end --]] --[[ function UGCPlayerStartManager:ReceiveEndPlay() self.SuperClass.ReceiveEndPlay(self); end --]] --[[ function UGCPlayerStartManager:GetReplicatedProperties() return end --]] --[[ function UGCPlayerStartManager:GetAvailableServerRPCs() return end --]] return UGCPlayerStartManager;