forked from endernon/PGRData
23 lines
No EOL
776 B
Lua
23 lines
No EOL
776 B
Lua
local XHomeCharInteractStop = XLuaBehaviorManager.RegisterNode(XLuaBehaviorNode, "HomeCharInteractStop", CsBehaviorNodeType.Condition, true, false)
|
|
|
|
|
|
function XHomeCharInteractStop:OnGetEvents()
|
|
return { XEventId.EVENT_DORM_INTERACT_STOP }
|
|
end
|
|
|
|
function XHomeCharInteractStop:OnEnter()
|
|
self.PlayerId = self.AgentProxy:GetPlayerId()
|
|
end
|
|
|
|
function XHomeCharInteractStop:OnNotify(evt, ...)
|
|
local args = { ... }
|
|
|
|
if evt == XEventId.EVENT_DORM_INTERACT_STOP and args[1] == self.PlayerId then
|
|
self.Node.Status = CsNodeStatus.SUCCESS
|
|
if not XTool.UObjIsNil(self.Agent) then
|
|
self.Agent:SetVarDicByKey("InteractStopSuccess", true)
|
|
else
|
|
XLog.Error("行为树节点HomeCharInteractStop Agent为nil")
|
|
end
|
|
end
|
|
end |