2023-07-15 02:35:33 +07:00
|
|
|
local XHomeCharStateChangeNode = XLuaBehaviorManager.RegisterNode(XLuaBehaviorNode, "HomeCharStateChange",CsBehaviorNodeType.Action,true,false)
|
|
|
|
|
|
|
|
function XHomeCharStateChangeNode:OnAwake()
|
|
|
|
if self.Fields == nil then
|
|
|
|
self.Node.Status = CsNodeStatus.ERROR
|
|
|
|
return
|
|
|
|
end
|
|
|
|
|
|
|
|
if self.Fields["State"] == nil then
|
|
|
|
self.Node.Status = CsNodeStatus.ERROR
|
|
|
|
return
|
|
|
|
end
|
|
|
|
|
|
|
|
self.State = self.Fields["State"]
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
function XHomeCharStateChangeNode:OnEnter()
|
2024-09-01 22:49:41 +02:00
|
|
|
if self.AgentProxy.Role then --工会
|
|
|
|
local isIgnore=not XDataCenter.GuildDormManager.CheckNpcIsStatic(self.AgentProxy.Role.RefreshId)
|
|
|
|
self.AgentProxy:ChangeStatus(self.State,isIgnore)
|
|
|
|
else --宿舍
|
|
|
|
self.AgentProxy:ChangeStatus(self.State)
|
|
|
|
end
|
|
|
|
|
2023-07-15 02:35:33 +07:00
|
|
|
self.Node.Status = CsNodeStatus.SUCCESS
|
|
|
|
end
|
|
|
|
|