81 lines
2.2 KiB
Lua
81 lines
2.2 KiB
Lua
---@class BP_CheckPoints_2_C:AActor
|
|
---@field FX_Hide UParticleSystemComponent
|
|
---@field FX_Loop UParticleSystemComponent
|
|
---@field Sphere USphereComponent
|
|
---@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_2 = {
|
|
OverlapPlayers = {};
|
|
};
|
|
|
|
|
|
function BP_CheckPoints_2:ReceiveBeginPlay()
|
|
self.SuperClass.ReceiveBeginPlay(self);
|
|
if UGCGameSystem.IsServer() then
|
|
UGCSystemLibrary.BindBeginOverlapFunc(self.Box, self.PlayerOverlapCheckPoint, self)
|
|
else
|
|
if self.PointIndex == 0 then
|
|
self.FX_Loop:SetActive(false, false)
|
|
end
|
|
end
|
|
end
|
|
|
|
function BP_CheckPoints_2: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_2:GetPointIndex()
|
|
return self.PointIndex
|
|
end
|
|
|
|
function BP_CheckPoints_2:GetRespawnTF()
|
|
return self.Sphere:K2_GetComponentLocation(), self.Arrow:K2_GetComponentRotation()
|
|
end
|
|
|
|
function BP_CheckPoints_2:ClientEffect()
|
|
if self.IsDestination then
|
|
UGCSoundManagerSystem.PlaySound2D(self.DestinationSound)
|
|
else
|
|
UGCSoundManagerSystem.PlaySound2D(self.DefaultSound)
|
|
end
|
|
self.FX_Loop:SetActive(false, false)
|
|
self.FX_Hide:SetActive(true, true)
|
|
end
|
|
|
|
--[[
|
|
function BP_CheckPoints_2:ReceiveTick(DeltaTime)
|
|
self.SuperClass.ReceiveTick(self, DeltaTime);
|
|
end
|
|
--]]
|
|
|
|
--[[
|
|
function BP_CheckPoints_2:ReceiveEndPlay()
|
|
self.SuperClass.ReceiveEndPlay(self);
|
|
end
|
|
--]]
|
|
|
|
--[[
|
|
function BP_CheckPoints_2:GetReplicatedProperties()
|
|
return
|
|
end
|
|
--]]
|
|
|
|
--[[
|
|
function BP_CheckPoints_2:GetAvailableServerRPCs()
|
|
return
|
|
end
|
|
--]]
|
|
|
|
return BP_CheckPoints_2; |