2025-01-04 23:00:19 +08:00

72 lines
1.9 KiB
Lua

---@class BP_CheckPoints_C:AActor
---@field Arrow UArrowComponent
---@field Box UBoxComponent
---@field DefaultSceneRoot USceneComponent
---@field PointIndex int32
---@field IsDestination bool
---@field DestinationSound UAkAudioEvent
---@field DefaultSound UAkAudioEvent
--Edit Below--
local BP_CheckPoints = {
OverlapPlayers = {};
};
function BP_CheckPoints:ReceiveBeginPlay()
self.SuperClass.ReceiveBeginPlay(self);
if UGCGameSystem.IsServer() then
UGCSystemLibrary.BindBeginOverlapFunc(self.Box, self.PlayerOverlapCheckPoint, self)
end
end
function BP_CheckPoints:PlayerOverlapCheckPoint(OverlappedComponent, OtherActor, OtherComp, OtherBodyIndex, bFromSweep, SweepResult)
if OtherActor and OtherActor.PlayerKey and not table.hasValue(self.OverlapPlayers, OtherActor.PlayerKey) then
self.OverlapPlayers[#self.OverlapPlayers + 1] = OtherActor.PlayerKey
UGCEventSystem.SendEvent(EventEnum.OverlapCheckPoint, OtherActor.PlayerKey, self.PointIndex, self.IsDestination)
if self.PointIndex > 0 then
UGCSendRPCSystem.ActorRPCNotify(OtherActor.PlayerKey, self, "ClientEffect")
end
end
end
function BP_CheckPoints:GetPointIndex()
return self.PointIndex
end
function BP_CheckPoints:GetRespawnTF()
return self.Arrow:K2_GetComponentLocation(), self.Arrow:K2_GetComponentRotation()
end
function BP_CheckPoints:ClientEffect()
if self.IsDestination then
UGCSoundManagerSystem.PlaySound2D(self.DestinationSound)
else
UGCSoundManagerSystem.PlaySound2D(self.DefaultSound)
end
end
--[[
function BP_CheckPoints:ReceiveTick(DeltaTime)
self.SuperClass.ReceiveTick(self, DeltaTime);
end
--]]
--[[
function BP_CheckPoints:ReceiveEndPlay()
self.SuperClass.ReceiveEndPlay(self);
end
--]]
--[[
function BP_CheckPoints:GetReplicatedProperties()
return
end
--]]
--[[
function BP_CheckPoints:GetAvailableServerRPCs()
return
end
--]]
return BP_CheckPoints;