local FuncNode_GetEntityCategory = class("FuncNode_GetEntityCategory") local EEntityCategory = { HERO = 10001, } --[[ 初始化 --]] function FuncNode_GetEntityCategory:initialize(entity) self.LimitChildCount = 1 self.Type = LuaConst.ConditionFuncType.GetEntityCategory end --[[ 执行 --]] function FuncNode_GetEntityCategory:Run(conditionDataNode, entity, missile) local result = 0 if entity then local targetType = conditionDataNode.FirstNode:Run(entity, missile) if targetType ~= FP.Const.Two then --参数1~=2时,判断主人的类型 entity = entity:GetMasterEntity() or entity end if entity._logicInitData.CharacterType == LuaConst.CharacterType.Monster then result = entity._logicInitData._characterData.MonsterType elseif entity._logicInitData.CharacterType == LuaConst.CharacterType.Hero then result = EEntityCategory.HERO --先写死,如果以后需要拓展了再整理 end end result = FP.newV1(result) return result end return FuncNode_GetEntityCategory