local ExpModelComponent = class("ExpModelComponent") function ExpModelComponent:initialize(expEntity) --当前模型层 local entity = expEntity.Entity local comp_Base = entity.components.base local logicInitData = entity._logicInitData local friendCamp = logicInitData.EntityCampID == LevelPlayerManager.MainEntityCampID local isBossLayer = comp_Base.CurMonsterFeature.IsBossLayer local characterType = logicInitData.CharacterType if characterType == LuaConst.CharacterType.Hero then if logicInitData.IsPlayerSelf then self.Layer = LuaConst.Layer.Hero_Self else self.Layer = friendCamp and LuaConst.Layer.Hero_Friend or LuaConst.Layer.Hero_Enemy end elseif characterType == LuaConst.CharacterType.NPC then self.Layer = LuaConst.Layer.NPC_Function elseif isBossLayer then self.Layer = friendCamp and LuaConst.Layer.Boss_Friend or LuaConst.Layer.Boss_Enemy else self.Layer = friendCamp and LuaConst.Layer.Soldier_Friend or LuaConst.Layer.Soldier_Enemy end self.NeedDissolve = comp_Base.CurModelData.IfDissolve self.lightEffectIDs = {} --光效 self.CurModelID = logicInitData._modelData.ID self.CurModelID = nil -- 当前RenderEntity显示的模型ID self.AppearanceModelData = nil -- 当前的特殊外显ID (有这个值的时候,换神兵、时装 、突破特效 等表现层不生效) end function ExpModelComponent:SetAppearanceId(appearanceId) if appearanceId == 0 then self.AppearanceId = nil self.AppearanceModelData = nil else self.AppearanceId = appearanceId self.AppearanceModelData = DataSheetManager.MonsterModelData:GetDataByID(appearanceId) end end return ExpModelComponent