-- 这个脚本是记录主将出生点信息 local EventSystem = require('Event/EventSystem') local Base = require("Battle/Logic/Level/LevelItemFactory/LevelItem") local LevelItem_BornPoint = class("LevelItem_BornPoint", Base) -- 构造函数 ,使用的时候用new ,如果没有特殊的变量设置,不需要这个函数 function LevelItem_BornPoint:initialize(data) Base.initialize(self,data) self.BornPointID = data.BornPointID end --region --***************生命周期***************-- function LevelItem_BornPoint:OnActive() if Base.OnActive(self) then EventSystem.Regist(self.LevelItemID..EventID._EntityDead, self.OnPlayerDead, self) --出生点设置相机角度 if self.ItemData and self.ItemData.CamAngle and self.ItemData.CamAngle~=0 then CameraController.Instance:SetNormalCamAngele(self.ItemData.CamAngle) end return true end end function LevelItem_BornPoint:OnDeactive() if Base.OnDeactive(self) then EventSystem.UnRegist(self.LevelItemID..EventID._EntityDead,self.OnPlayerDead,self) return true end end function LevelItem_BornPoint:OnDestroy() Base.OnDestroy(self) self.BornPointID = nil end --region 生命周期 --region --***************事件相关***************-- function LevelItem_BornPoint:OnPlayerDead(entity) if entity._logicInitData.CharacterType == LuaConst.CharacterType.Adjutant then return end LevelItemManager.Global:Notify_PlayerDead(entity, self.LevelItemID) end --endregion 事件相关 return LevelItem_BornPoint