PGRData/Resources/Scripts/XHome/XDorm/XHomeChar/XHomeCharNode/XHomeCharChangeStateMachineNode.lua
2022-12-26 14:06:01 +05:30

21 lines
643 B
Lua

local XHomeCharChangeStateMachineNode = XLuaBehaviorManager.RegisterNode(XLuaBehaviorNode, "HomeCharChangeStateMachine",CsBehaviorNodeType.Action,true,false)
function XHomeCharChangeStateMachineNode:OnAwake()
if self.Fields == nil then
self.Node.Status = CsNodeStatus.ERROR
return
end
if self.Fields["StateMachine"] == nil then
self.Node.Status = CsNodeStatus.ERROR
return
end
self.StateMachine = self.Fields["StateMachine"]
end
function XHomeCharChangeStateMachineNode:OnEnter()
self.AgentProxy:ChangeStateMachine(self.StateMachine)
self.Node.Status = CsNodeStatus.SUCCESS
end