UGCProjects/GZJ/Script/Blueprint/AI/BTT_SkillCount.lua
2025-01-08 22:46:12 +08:00

25 lines
730 B
Lua

---@class BTT_SkillCount_C:BTTask_LuaBase
---@field PlaySkillIndex int32
---@field SkillType TEnumAsByte<UTSkillEventType>
--Edit Below--
local BTT_SkillCount = {}
-- entry point, task will stay active until FinishExecute is called
function BTT_SkillCount:ReceiveExecuteAI(OwnerController, ControlledPawn)
if ControlledPawn == nil then
self:FinishExecute(true)
return
end
local SkillManager = ControlledPawn:GetSkillManagerComponent()
if SkillManager ~= nil then
SkillManager:TriggerEvent(self.PlaySkillIndex, self.SkillType)
end
if ControlledPawn.UpdateSkillCount ~= nil then
ControlledPawn:UpdateSkillCount()
end
self:FinishExecute(true)
end
return BTT_SkillCount