local FuncNode_InteractEntityHasBeDriven = class("FuncNode_InteractEntityHasBeDriven") --[[ 初始化 --]] function FuncNode_InteractEntityHasBeDriven:initialize(entity) self.LimitChildCount = 1 self.Type = LuaConst.ConditionFuncType.InteractEntityHasBeDriven end --[[ 执行 --]] function FuncNode_InteractEntityHasBeDriven:Run(conditionDataNode, entity, missile) --local colliderTriggerEntity = entity.components.interact:GetLastInteractEntity() --local cmdOpInteractEntity = entity.components.interact:GetCmdOpInteractEntity() local targetType = conditionDataNode.FirstNode:Run(entity, missile) local checkEntity = nil if targetType == FP.Const.Zero then --进入的交互区域所属的交互物【一定是用于判断交互UI是否显示】 checkEntity = entity.components.interact:GetLastInteractEntity() elseif targetType == FP.Const.One then --执行命令的交互物【一定是用于判断交互cmd是否可执行时】 checkEntity = entity.components.interact:GetCmdOpInteractEntity() else checkEntity = entity.components.interact:GetLastInteractEntity() end local hasBeDriven = checkEntity.components.drive.BeDrived return hasBeDriven and FP.Const.One or FP.Const.Zero end return FuncNode_InteractEntityHasBeDriven