PGRData/Script/matrix/xrestaurant/xnode/XRestaurantCheckIntNode.lua

30 lines
809 B
Lua
Raw Normal View History

2024-09-01 20:49:41 +00:00
---@class XRestaurantCheckIntNode : XLuaBehaviorNode
---@field AgentProxy XRestaurantCharAgent
local XRestaurantCheckIntNode = XLuaBehaviorManager.RegisterNode(XLuaBehaviorNode,
"RestaurantCheckInt", CsBehaviorNodeType.Condition, true, false)
function XRestaurantCheckIntNode:OnAwake()
if self.Fields == nil then
self.Node.Status = CsNodeStatus.ERROR
return
end
if self.Fields["IntValue"] == nil then
self.Node.Status = CsNodeStatus.ERROR
return
end
self.IntValue = self.Fields["IntValue"]
end
function XRestaurantCheckIntNode:OnEnter()
local isEqual = self.AgentProxy:DoCheckInt(self.IntValue)
if isEqual then
self.Node.Status = CsNodeStatus.SUCCESS
else
self.Node.Status = CsNodeStatus.FAILED
end
end