local FuncNode_GetAttrValue = class("FuncNode_GetAttrValue") --[[ 初始化 --]] function FuncNode_GetAttrValue:initialize(entity) self.LimitChildCount = 2 self.Type = LuaConst.ConditionFuncType.GetAttrValue end --[[ 执行 --]] function FuncNode_GetAttrValue:Run(conditionDataNode, entity, missile) local attrType = FP.tonumberV1(conditionDataNode.FirstNode:Run(entity, missile)) local targetType = conditionDataNode.SecondNode:Run(entity, missile) local target if targetType == FP.Const.One then target = entity.components.target.Target elseif targetType == FP.Const.Two then target = entity:GetMasterEntity() else target = entity end local attrValue if target then if attrType > 0 then attrValue = target:GetAttrValue(LuaConst.AttrIntType[attrType]) else attrValue = target:GetAttrValue(LuaConst.RealtimeAttrIntType[-attrType]) end end return attrValue or FP.Const.Zero end return FuncNode_GetAttrValue