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

75 lines
2.0 KiB
Lua

---@class SkillAction_SpawnActor_C:UAESkillActionBP
---@field DefaultActorClass UClass
---@field AlignToPlayer bool
---@field RelativeTF FTransform
---@field TargetTF FTransform
--Edit Below--
local SkillAction_SpawnActor = {
}
function SkillAction_SpawnActor:ReceiveBeginPlay()
SkillAction_SpawnActor.SuperClass.ReceiveBeginPlay(self)
end
function SkillAction_SpawnActor:ReceiveTick(DeltaTime)
SkillAction_SpawnActor.SuperClass.ReceiveTick(self, DeltaTime)
end
function SkillAction_SpawnActor:ReceiveEndPlay()
SkillAction_SpawnActor.SuperClass.ReceiveEndPlay(self)
end
--Action开始执行调用
function SkillAction_SpawnActor:OnRealDoAction()
local OwnerPawn = self:GetOwnerPawn()
if UE.IsValid(OwnerPawn) then
if self.AlignToPlayer then
self.TargetTF.Translation = VectorHelper.Add(OwnerPawn:K2_GetActorLocation(), self.RelativeTF.Translation)
self.TargetTF.Rotation = self.RelativeTF.Rotation
self.TargetTF.Scale3D = VectorHelper.Mul(self.TargetTF.Scale3D, OwnerPawn:GetActorScale3D())
end
local TargetActor = UGCGameSystem.SpawnActor(UGCGameSystem.GameState, self.DefaultActorClass, self.TargetTF.Translation, self.TargetTF.Rotation, self.TargetTF.Scale3D)
if TargetActor["SetOwnerPlayerPawn"] then
TargetActor:SetOwnerPlayerPawn(OwnerPawn)
UGCLogSystem.Log("[SkillAction_SpawnActor_OnRealDoAction] Succeed")
end
UGCLogSystem.Log("[SkillAction_SpawnActor_OnRealDoAction] Finish")
else
UGCLogSystem.LogError("[SkillAction_SpawnActor_OnRealDoAction] OwnerPawn is not Valid.")
end
return true
end
--技能执行完毕调用
function SkillAction_SpawnActor:OnReset()
return true
end
--Action每一帧调用
function SkillAction_SpawnActor:OnUpdateAction(DeltaSeconds)
return true
end
--[[
function SkillAction_SpawnActor:GetReplicatedProperties()
return
end
--]]
--[[
function SkillAction_SpawnActor:GetAvailableServerRPCs()
return
end
--]]
return SkillAction_SpawnActor