UGCProjects/FX_Preview/Script/FX/BulletFX/BP_BulletTailFX.lua
2025-01-14 15:38:12 +08:00

74 lines
1.8 KiB
Lua

---@class BP_BulletTailFX_C:AActor
---@field BulletFXComp UParticleSystemComponent
---@field ProjectileMovement UProjectileMovementComponent
---@field DefaultSceneRoot USceneComponent
---@field ShowTime float
--Edit Below--
local BP_BulletTailFX = {
IsActiveFly = false;
}
--[[
function BP_BulletTailFX:ReceiveBeginPlay()
BP_BulletTailFX.SuperClass.ReceiveBeginPlay(self)
end
--]]
--[[
function BP_BulletTailFX:ReceiveTick(DeltaTime)
BP_BulletTailFX.SuperClass.ReceiveTick(self, DeltaTime)
end
--]]
--[[
function BP_BulletTailFX:ReceiveEndPlay()
BP_BulletTailFX.SuperClass.ReceiveEndPlay(self)
end
--]]
--[[
function BP_BulletTailFX:GetReplicatedProperties()
return
end
--]]
--[[
function BP_BulletTailFX:GetAvailableServerRPCs()
return
end
--]]
function BP_BulletTailFX:ActiveFly(Rot, Pos, Velocity, ParticleSystemTemplate)
UGCLogSystem.Log("[BP_BulletTailFX_ActiveFly]")
if self.IsActiveFly then
if self.AutoStopFlyHandle then
UGCEventSystem.StopTimer(self.AutoStopFlyHandle)
end
end
self.AutoStopFlyHandle = UGCEventSystem.SetTimer(self, self.StopFly, self.ShowTime)
self.IsActiveFly = true
self:K2_SetActorRotation(Rot)
self:K2_SetActorLocation(Pos)
if self.BulletFXComp.Template ~= ParticleSystemTemplate then
self.BulletFXComp:SetTemplate(ParticleSystemTemplate)
end
self.BulletFXComp:SetActive(true, true)
self.ProjectileMovement.Velocity = Velocity
self.BulletFXComp:SetHiddenInGame(false, true);
end
function BP_BulletTailFX:StopFly()
self.BulletFXComp:SetHiddenInGame(true, true);
self.BulletFXComp:SetActive(false, true)
self.ProjectileMovement.Velocity = {X=0,Y=0,Z=0}
self.AutoStopFlyHandle = nil
self.IsActiveFly = false
end
return BP_BulletTailFX