--死亡相关 local DeadComponent = class("DeadComponent") function DeadComponent:initialize(entity) --我召唤出的所有entity,跟随我死的列表;不包括副将 self.FollowDeadEntityList = nil end function DeadComponent:BindDead(sonEntity) if not self.FollowDeadEntityList then self.FollowDeadEntityList = {} end table.insert(self.FollowDeadEntityList,sonEntity) -- 不作排重的原因是,一人只能出生一次 end function DeadComponent:UnBindDead(sonEntity) if self.FollowDeadEntityList then table.removebyvalue(self.FollowDeadEntityList,sonEntity ,true) end end function DeadComponent:GetFollowDeadList() return self.FollowDeadEntityList end function DeadComponent:ResetFollowDeadList() self.FollowDeadEntityList = nil end return DeadComponent