PGRData/Script/matrix/xrestaurant/xnode/XRestaurantDoActionIndexOnlyNode.lua
2024-09-01 22:49:41 +02:00

27 lines
No EOL
963 B
Lua

---@class XRestaurantDoActionIndexOnlyNode : XLuaBehaviorNode
---@field AgentProxy XRestaurantCharAgent
local XRestaurantDoActionIndexOnlyNode = XLuaBehaviorManager.RegisterNode(XLuaBehaviorNode,
"RestaurantDoActionIndexOnly", CsBehaviorNodeType.Action, true, false)
function XRestaurantDoActionIndexOnlyNode:OnAwake()
if self.Fields == nil then
self.Node.Status = CsNodeStatus.ERROR
return
end
if self.Fields["Index"] == nil or self.Fields["NeedFadeCross"] == nil or self.Fields["CrossDuration"] == nil then
self.Node.Status = CsNodeStatus.ERROR
return
end
self.Index = self.Fields["Index"]
self.NeedFadeCross = self.Fields["NeedFadeCross"]
self.CrossDuration = self.Fields["CrossDuration"]
end
function XRestaurantDoActionIndexOnlyNode:OnEnter()
self.AgentProxy:DoActionIndex(self.Index, self.NeedFadeCross, self.CrossDuration)
self.Node.Status = CsNodeStatus.SUCCESS
end