--- 无尽副本 --- Generated by EmmyLua(https://github.com/EmmyLua) --- Created by aaa. --- DateTime: 2019/7/30 16:30 --- EndLessMapView = {} local this = EndLessMapView local endLessData = ConfigManager.GetConfig(ConfigName.EndlessMapConfig) local challengeMapConfig = ConfigManager.GetConfig(ConfigName.ChallengeMapConfig) local heroConfig = ConfigManager.GetConfig(ConfigName.HeroConfig) local endlessMorale = ConfigManager.GetConfig(ConfigName.endlessMorale) local PassiveSkillConfig = ConfigManager.GetConfig(ConfigName.PassiveSkillConfig) local PropertyConfig = ConfigManager.GetConfig(ConfigName.PropertyConfig) local ctrlView = require("Modules/Map/View/MapControllView") local pointView = require("Modules/Map/View/PointHandleView") local MapPanel local isShow = false this.shiQiValueId = 101 this.isPanelClose = false -- 刷新前的行动力,用于判断递减 local preEnergy = 0 -- 当前地图扣除行动力的类型 local COST_TYPE = { WALK = 1, DEAD = 2, TRANSPORT = 3, } -- 当前地图行走与死亡消耗的行动力 local deadCost = 0 local walkCost = 0 function EndLessMapView:InitComponent(gameObject, mapPanel) this.spLoader = SpriteLoader.New() MapPanel = mapPanel -- 地图名字显示 this.areaName = Util.GetGameObject(gameObject, "endLessTitle/AreaImg/mapName"):GetComponent("Text") this.btnReset = Util.GetGameObject(gameObject, "rightDown/btnReset") this.btnFormat = Util.GetGameObject(gameObject, "rightDown/btnFormat") this.btnNote = Util.GetGameObject(gameObject, "rightDown/btnNote") this.btnNoteRed = Util.GetGameObject(this.btnNote, "redPoint") -- 谢置按钮 this.btnSet = Util.GetGameObject(gameObject, "rightUp/btnSetting") -- 行动力显示 this.energyInfo = Util.GetGameObject(gameObject, "stepROot/bg/energyInfo"):GetComponent("Text") this.totalEnergy = Util.GetGameObject(gameObject, "stepROot/bg/total"):GetComponent("Text") this.btnAddEnergy = Util.GetGameObject(gameObject, "stepROot/bg/add") this.energyRoot = Util.GetGameObject(gameObject, "stepROot") -- 行动力警告显示 this.warn = Util.GetGameObject(gameObject, "EndLessEffect/effect") this.warnRoot = Util.GetGameObject(gameObject, "EndLessEffect") -- 根节点 this.endLessTitleRoot = Util.GetGameObject(gameObject, "endLessTitle") -- 道刷刷新倒计时 this.bgTime = Util.GetGameObject(gameObject, "stepROot/bg/Bgtime") this.actCountTime = Util.GetGameObject(this.bgTime, "time"):GetComponent("Text") -- 购买行动力的货币 this.moneyNum = Util.GetGameObject(gameObject, "endLessTitle/frame/num") this.moneyIcon = Util.GetGameObject(gameObject, "endLessTitle/frame/icon") this.helpBtn=Util.GetGameObject(gameObject,"helpBtn") this.helpPos=this.helpBtn:GetComponent("RectTransform").localPosition this.helpBtn:SetActive(false) this.TargetRoot = Util.GetGameObject(gameObject,"TargetRoot") this.TargetRootText = Util.GetGameObject(this.TargetRoot,"Image/Text"):GetComponent("Text") this.TargetBtn1 = Util.GetGameObject(this.btnNote,"weiwancheng"):GetComponent("Image") this.TargetBtn2 = Util.GetGameObject(this.btnNote,"yiwancheng"):GetComponent("Image") this.curMission = {} this.centerDown = Util.GetGameObject(gameObject,"centerDown") this.bufflist = Util.GetGameObject(this.centerDown,"bufflist") this.selectHero = Util.GetGameObject(this.centerDown,"selectHero") this.selectHeroTip = Util.GetGameObject(this.selectHero,"tip") this.selectPre = Util.GetGameObject(this.selectHero,"pre") this.selectHeroGrid = Util.GetGameObject(this.selectHero,"grid") this.enemyInfo = Util.GetGameObject(this.centerDown,"enemyInfo") this.leftCenter = Util.GetGameObject(gameObject,"leftCenter") this.shiQi = Util.GetGameObject(this.leftCenter,"shiQi") this.shiQiProgress = Util.GetGameObject(this.shiQi,"Image/progress"):GetComponent("Text") this.shiQiLv = Util.GetGameObject(this.shiQi,"lv"):GetComponent("Text") this.shiQifillAmount = Util.GetGameObject(this.shiQi,"Image/mask"):GetComponent("Image") this.endLessTreasure = Util.GetGameObject(this.leftCenter,"endLessTreasure") this.endLessTreasureRed = Util.GetGameObject(this.endLessTreasure ,"redPoint") end function EndLessMapView:OnSortingOrderChange() end function EndLessMapView:BindEvent() -- --帮助按钮 -- Util.AddClick(this.helpBtn,function() -- if ctrlView.GetCallListCount() > 1 then -- PopupTipPanel.ShowTip(Language[11259]) -- return -- end -- UIManager.OpenPanel(UIName.HelpPopup,HELP_TYPE.Sunro,this.helpPos.x,this.helpPos.y) -- end) -- -- 重置 -- Util.AddClick(this.btnReset, function () -- if ctrlView.GetCallListCount() > 1 then -- PopupTipPanel.ShowTip(Language[11259]) -- return -- end -- if not this:CanClick() then return end -- -- 复位角色的状态 -- MsgPanel.ShowTwo(Language[11277], nil, function() -- this.ResetRoleState() -- end) -- end) Util.AddClick(this.shiQi, function () if ctrlView.GetCallListCount() > 1 then PopupTipPanel.ShowTip(Language[11259]) return end if not this:CanClick() then return end local u = function(pro) local str = "" for i = 1,#pro do if i ~= 1 then str = str .. "," end local config = ConfigManager.GetConfigData(ConfigName.PropertyConfig,pro[i][1]) str = str .. config.Info .. "+" str = str .. GetEquipPropertyFormatStr(config.Style,pro[i][2]) end return str end local s = function(index) local id, lv = EndLessMapManager.GetShiQiValue() local pro1,nextPro = nil local pro = {} if index == 1 then --属性加成 pro1 = (endlessMorale[id].Props and #endlessMorale[id].Props > 0) and endlessMorale[id].Props or {} local str = u(pro1) if str and str ~= "" then table.insert(pro,string.format("本级加成:全体神将%s",str)) end nextPro = (endlessMorale[id + 1] and endlessMorale[id + 1].Props and #endlessMorale[id + 1].Props > 0) and endlessMorale[id + 1].Props or {} if str and str ~= "" then table.insert(pro,string.format("下级加成:全体神将%s",str)) end else --特殊加成 for k,v in ConfigPairs(endlessMorale) do if v.Skill and v.Skill > 0 then table.insert(pro,string.format("%s级:%s",v.Level,PassiveSkillConfig[v.Skill].Desc)) end end end return pro end local data = {} local singData = {} singData.title = "属性加成" singData.pro = s(1) table.insert(data,singData) local singData = {} singData.title = "特殊加成" singData.pro = s(2) table.insert(data,singData) -- for i = 1 ,#data do -- LogGreen("data[i]:"..data[i].title.." #pro:"..#data[i].pro) -- for k,v in ipairs(data[i].pro) do -- LogGreen("data[i]:"..v) -- end -- end UIManager.OpenPanel(UIName.GeneralBigPopup,GENERAL_POPUP_TYPE.WuJinShuXing,data) end) BindRedPointObject(RedPointType.wujinTreasure,this.endLessTreasureRed) Util.AddClick(this.endLessTreasure, function () if ctrlView.GetCallListCount() > 1 then PopupTipPanel.ShowTip(Language[11259]) return end if not this:CanClick() then return end local data = EndLessMapManager.treasureData UIManager.OpenPanel(UIName.EndLessTreasurePanel,data) end) Util.AddClick(this.btnFormat, function () if ctrlView.GetCallListCount() > 1 then PopupTipPanel.ShowTip(Language[11259]) return end if not this:CanClick() then return end NetManager.RequestAllHeroHp(function () -- UIManager.OpenPanel(UIName.FormationPanel, FORMATION_TYPE.CARBON, MapManager.curMapId) UIManager.OpenPanel(UIName.FormationPanelV2, FORMATION_TYPE.CARBON, MapManager.curMapId) EndLessMapManager.openedFormat = true end) end) BindRedPointObject(RedPointType.wujinMission,this.btnNoteRed) Util.AddClick(this.btnNote, function () if this.curMission.state == 1 then NetManager.TakeMissionRewardRequest(TaskTypeDef.wujinfuben,this.curMission.Id,function(msg) UIManager.OpenPanel(UIName.RewardItemPopup,msg.drop,1,function (msg) this:RefreshTargetRoote() end) end) else if ctrlView.GetCallListCount() > 1 then PopupTipPanel.ShowTip(Language[11259]) return end if not this:CanClick() then return end UIManager.OpenPanel(UIName.TrialRewardPopup,EndLessMapManager.SetRewardData(),function(id,rewardFunc) NetManager.TakeMissionRewardRequest(TaskTypeDef.wujinfuben,id,function (msg) UIManager.OpenPanel(UIName.RewardItemPopup,msg.drop,1,function() this:RefreshTargetRoote() if rewardFunc then rewardFunc() end -- CheckRedPointStatus(RedPointType.TrialReward) -- CheckRedPointStatus(RedPointType.Trial) end) end) end,1) end end) Util.AddClick(this.btnAddEnergy, function () if ctrlView.GetCallListCount() > 1 then PopupTipPanel.ShowTip(Language[11259]) return end Log("行走路径长度 ----- " .. #MapManager.stepList) if not this:CanClick() then return end if #MapManager.stepList > 0 then MapManager.MapUpdateEvent(-1000, function () Log("购买之前同步位置!!") UIManager.OpenPanel(UIName.QuickPurchasePanel, { type = 1 }) end) else UIManager.OpenPanel(UIName.QuickPurchasePanel, { type = 1 }) end end) end function EndLessMapView:AddListener() Game.GlobalEvent:AddEvent(GameEvent.Map.OnAddNotePoint, this.SetNoteShow) Game.GlobalEvent:AddEvent(GameEvent.Map.OnRemoveNotePoint, this.SetNoteShow) Game.GlobalEvent:AddEvent(GameEvent.Bag.BagGold, this.GetBagEnergy) Game.GlobalEvent:AddEvent(GameEvent.Map.EnergyFull, EndLessMapManager.EndlessRedCheck) Game.GlobalEvent:AddEvent(GameEvent.EndLess.MissonChange,this.RefreshTargetRoote) Game.GlobalEvent:AddEvent(GameEvent.EndLess.RefreshHeroData,this.OnShow) end function EndLessMapView:RemoveListener() Game.GlobalEvent:RemoveEvent(GameEvent.Map.OnAddNotePoint, this.SetNoteShow) Game.GlobalEvent:RemoveEvent(GameEvent.Map.OnRemoveNotePoint, this.SetNoteShow) Game.GlobalEvent:RemoveEvent(GameEvent.Bag.BagGold, this.GetBagEnergy) Game.GlobalEvent:RemoveEvent(GameEvent.Map.EnergyFull, EndLessMapManager.EndlessRedCheck) Game.GlobalEvent:RemoveEvent(GameEvent.EndLess.RefreshHeroData,this.OnShow) end function EndLessMapView:OnOpen() -- 初始化组件显示 this:InitCompShow(CarbonManager.difficulty) if not this:IsEndLessMap() then return end -- 初始化各种标志的状态 this:InitBoolState() -- 开始探索请求 -- this.StartExplore() -- MapPanel.SetRoleShow(MapManager.mapScale, MapManager.roleInitPos,0) -- 设置任务显示 this:SetTipShow() -- 初始化行动力消耗的类型数值 this:InitCostValue() this:RefreshEnergyValue(true, 0) this:RefreshEnergyShow() Util.GetGameObject(MapPanel.gameObject, "centerDown/selectHero"):SetActive(false) this.helpBtn:SetActive(false) -- 检测引导 GuideManager.CheckCarbonGuild(CARBON_TYPE.ENDLESS) end function EndLessMapView:OnShow() if not this:IsEndLessMap() then return end -- 避免其他界面打开时不刷新问题 -- 界面再次打开时,如果没有主动刷新过,则不需要刷新显示 --if not EndLessMapManager.isUpdateOnClose and not EndLessMapManager.openedFormat then -- this:GetBagEnergy() -- EndLessMapManager.isUpdateOnClose = false --end -- 如果全屏界面打开时刷新过,重新激活界面需要刷新一次 if EndLessMapManager.isUpdateOnClose then this:GetBagEnergy() EndLessMapManager.isUpdateOnClose = false end -- 从编队界面切换回来,刷新事件点的战力显示 if EndLessMapManager.openedFormat then pointView.RefreshAtkShow() end EndLessMapManager.openedFormat = false this.isPanelClose = false -- 刷新倒计时显示 this:ShowCountTime() this:RefreshTargetRoote() NetManager.RequestAllHeroHp(function () this:ShowHeroData() end) end function EndLessMapView:ShowHeroData() local curFormation = EndLessMapManager.formation if not this.heroList then this.heroList = {} end LogGreen("#this.heroList:"..#this.heroList) for k = 1, #this.heroList do if this.heroList[k] and this.heroList[k].go then this.heroList[k].go.gameObject:SetActive(false) end end for i, v in ipairs(curFormation) do if not this.heroList[i] then this.heroList[i] = {} this.heroList[i].go = newObjToParent(this.selectPre,this.selectHeroGrid) this.heroList[i].go.name="pre"..i this.heroList[i].go:GetComponent("RectTransform").localScale = Vector2.New(0.9, 0.9) this.heroList[i].frame=Util.GetGameObject(this.heroList[i].go,"frame"):GetComponent("Image") this.heroList[i].icon=Util.GetGameObject(this.heroList[i].go,"icon"):GetComponent("Image") this.heroList[i].pro=Util.GetGameObject(this.heroList[i].go,"proIcon"):GetComponent("Image") this.heroList[i].lv=Util.GetGameObject(this.heroList[i].go,"lv/Text"):GetComponent("Text") this.heroList[i].star=Util.GetGameObject(this.heroList[i].go,"star") this.heroList[i].choosed=Util.GetGameObject(this.heroList[i].go,"choosed") this.heroList[i].hpExp=Util.GetGameObject(this.heroList[i].go,"hpExp"):GetComponent("Slider") end this.heroList[i].go.gameObject:SetActive(true) this.heroList[i].heroId = v.heroId local heroData = HeroManager.GetSingleHeroData(v.heroId) this.heroList[i].frame.sprite=Util.LoadSprite(GetHeroQuantityImageByquality(heroData.heroConfig.Quality, v.star)) SetHeroIcon(this.spLoader,heroData,this.heroList[i].icon,heroData.heroConfig) this.heroList[i].pro.sprite=Util.LoadSprite(GetProStrImageByProNum(heroData.heroConfig.PropertyName)) this.heroList[i].lv.text=heroData.lv --spLoader, starGrid, star, type,_starSize,_scale,_pivot,rotation SetHeroStars(this.spLoader,this.heroList[i].star, heroData.star) local heroData1 = EndLessMapManager.allHeroBlood[v.heroId] --血量相关 this.heroList[i].hpExp.value=heroData1.percentHp Util.SetGray(this.heroList[i].go,heroData1.percentHp<=0)--死啦 end end function EndLessMapView:RefreshTargetRoote() this.curMission = EndLessMapManager.GetRewardData() if this.curMission.state == 0 then this.TargetBtn1.gameObject:SetActive(false) this.TargetBtn2.gameObject:SetActive(true) this.TargetRootText.text = string.format("%s(%s/%s)",this.curMission.Desc,this.curMission.progress,this.curMission.value) else this.TargetBtn1.gameObject:SetActive(true) this.TargetBtn2.gameObject:SetActive(false) if this.curMission.index == #EndLessMapManager.mission and this.curMission.state == 2 then this.TargetRootText.text = "已完成全部任务" else this.TargetRootText.text = string.format("%s(%s/%s)",this.curMission.Desc,this.curMission.progress,this.curMission.value) end end end function EndLessMapView:SetShiQiValue() local cursinglePro local itemCount = BagManager.GetItemCountById(EndLessMapManager.shiQiValue) local id, lv = EndLessMapManager.GetShiQiValue() local oldId = 0 if lv ~= EndLessMapManager.moraleLv then isShow = true oldId = EndLessMapManager.moraleLv cursinglePro = endlessMorale[id] EndLessMapManager.moraleLv = lv EndLessMapManager.moraleId = id end this.shiQiProgress.text = (endlessMorale[id].Exp[2] and endlessMorale[id].Exp[2] > 0) and itemCount.."/"..endlessMorale[id].Exp[2] or "1/1" this.shiQiLv.text = lv.."级" this.shiQifillAmount.fillAmount = (endlessMorale[id].Exp[2] and endlessMorale[id].Exp[2] > 0) and itemCount/endlessMorale[id].Exp[2] or 1 if isShow then --士气等级提升 isShow = false local data = {} LogGreen("isShow:"..tostring(isShow) ) data.title = "r_wujin_shiqitishengzi" --士气等级提升图片 data.itemList = {} data.type = 2 local s = function(curId) LogGreen("curId:"..curId) local proPs = {} for k,v in ConfigPairs(endlessMorale) do if v.Id <= curId then for i = 1 ,#v.Props do if not proPs[v.Props[i][1]] then proPs[v.Props[i][1]] = 0 end proPs[v.Props[i][1]] = proPs[v.Props[i][1]] + v.Props[i][2] end end end return proPs end local upPro = s(id) for k,v in pairs(upPro) do LogGreen("k:"..k.." v:"..v) end for i = 1, #cursinglePro.Props do if not upPro[cursinglePro.Props[i][1]] then upPro[cursinglePro.Props[i][1]] = 0 upPro[cursinglePro.Props[i][1]] = upPro[cursinglePro.Props[i][1]] + cursinglePro.Props[i][2] end local singleItem = {} singleItem.icon = nil singleItem.proName = string.format("全体神将%s",PropertyConfig[cursinglePro.Props[i][1]].Info) LogGreen("k:"..cursinglePro.Props[i][1].." v:"..cursinglePro.Props[i][2]) singleItem.proValue = GetEquipPropertyFormatStr(upPro[cursinglePro.Props[i][1]] - cursinglePro.Props[i][2],PropertyConfig[cursinglePro.Props[i][1]].Style) singleItem.proValue1 = ""..GetEquipPropertyFormatStr(upPro[cursinglePro.Props[i][1]],PropertyConfig[cursinglePro.Props[i][1]].Style).."" table.insert(data.itemList,singleItem) end if cursinglePro.Skill and cursinglePro.Skill > 0 then local config = ConfigManager.GetConfigData(ConfigName.SkillConfig,cursinglePro.Skill) local singleItem = {} singleItem.icon = nil singleItem.proName = config.Desc singleItem.proValue = nil singleItem.proValue1 = nil table.insert(data.itemList,singleItem) end UIManager.OpenPanel(UIName.GeneralPopup,GENERAL_POPUP_TYPE.Onhook,data) end end function EndLessMapView:InitCompShow(carbonType) if carbonType ~= CARBON_TYPE.ENDLESS then return end this.btnReset.gameObject:SetActive(false) this.btnFormat:SetActive(true) this.areaName.gameObject:SetActive(true) this.btnSet:SetActive(true) this.endLessTitleRoot:SetActive(true) this.energyRoot:SetActive(true) this.btnNote.gameObject:SetActive(true) this.centerDown.gameObject:SetActive(true) this.bufflist.gameObject:SetActive(false) this.selectHero.gameObject:SetActive(true) this.selectHeroTip.gameObject:SetActive(false) this.selectHeroGrid.gameObject:SetActive(true) this.enemyInfo.gameObject:SetActive(false) this.shiQi.gameObject:SetActive(true) this.endLessTreasure.gameObject:SetActive(true) end -- ================================================ -- ============ 初始化设置 ========================= function EndLessMapView:IsEndLessMap() return CarbonManager.difficulty == CARBON_TYPE.ENDLESS end function EndLessMapView:SetTipShow() Log("MapManager.curMapId ========== " .. MapManager.curMapId) -- if not this:IsEndLessMap() then return end if not endLessData[MapManager.curMapId] then Log(Language[11278]) return end this.areaName.text = GetLanguageStrById(endLessData[MapManager.curMapId].Info) EndLessMapManager.curMapName = GetLanguageStrById(endLessData[MapManager.curMapId].Info) end function EndLessMapView:InitBoolState() EndLessMapManager.isCanNote = false EndLessMapManager.justEnterMap = true EndLessMapManager.isReset = false end -- =================================================== -- ========= 各种按键操作的设置 ========================= -- 标记设置 function EndLessMapView:SetNoteShow() -- 进入标记状态 EndLessMapManager.isCanNote = not EndLessMapManager.isCanNote local canNote = EndLessMapManager.isCanNote MapPanel.BtnBack:SetActive(not canNote) this.btnReset:SetActive(not canNote) this.btnFormat:SetActive(not canNote) this.btnSet:SetActive(not canNote) ctrlView.IsForbitLongClick(canNote) end -- 按钮可点击的判断 function EndLessMapView:CanClick() local canClick = true -- 如果正在触发事件,不可复位 if ctrlView.GetTriggerState() then PopupTipPanel.ShowTip(Language[11280]) return false end -- 正在寻路 if ctrlView.GetCallListCount() > 1 then PopupTipPanel.ShowTip(Language[11281]) return false end return canClick end --- ============= 行动力刷新显示 ============================== function EndLessMapView:OnRoleMove(u, v) -- 只有无尽副本才执行 if not this:IsEndLessMap() then return end this:RefreshEnergyValue(false, COST_TYPE.WALK) end -- 初始化数值 function EndLessMapView:InitCostValue() local mapData = endLessData[MapManager.curMapId] walkCost = mapData.WalkCost deadCost = mapData.DeathCost -- 同步一次道具数据 this:GetBagEnergy() -- 显示你有多少钱钱 this.moneyNum:GetComponent("Text").text = BagManager.GetTotalItemNum(1201) this.moneyIcon:GetComponent("Image").sprite = SetIcon(this.spLoader, 1201) end -- 根据类型刷新行动力数值 function EndLessMapView:RefreshEnergyValue(isInit, costType) -- 只是初始化返回 -- LogBlue("两次吧") if isInit then return end if EndLessMapManager.justEnterMap then EndLessMapManager.justEnterMap = false Log("刚进图的那一步不扣行动力") return end local curEnergy = EndLessMapManager.leftEnergy preEnergy = curEnergy -- 行走 if costType == COST_TYPE.WALK then curEnergy = curEnergy - walkCost <= 0 and 0 or curEnergy - walkCost -- 只要动一哈就不再是复位状态 EndLessMapManager.isReset = false -- 消除死亡状态 EndLessMapManager.EndLessRoleDead = false -- 消除重登状态 MapManager.isReloadEnter = false -- 行走时剩余行动力警告 if curEnergy == 5 and preEnergy > 5 then -- 停止寻路 if ctrlView.GetCallListCount() > 1 then ctrlView.StopWalk() end -- this.PlayWarnEffect() end -- 死翘翘 elseif costType == COST_TYPE.DEAD then -- 传送 elseif costType == COST_TYPE.TRANSPORT then end EndLessMapManager.leftEnergy = curEnergy EndLessMapManager.isHungery() this:RefreshEnergyShow() MapManager.MapUpdateEvent(-1000, function () this:ShowCountTime() end) end -- 刷新行动力组件显示 function EndLessMapView:RefreshEnergyShow() local curEnergy = EndLessMapManager.leftEnergy if curEnergy <= 0 then ctrlView.StopWalk() end -- 设置一下颜色 local str = "" if curEnergy <= 5 then str = string.format("%s", tostring(curEnergy)) else str = tostring(curEnergy) end this.energyInfo.text = str this.totalEnergy.text = "" end -- 刷新数值 function EndLessMapView:GetBagEnergy() -- 无尽副本才刷新 if not this:IsEndLessMap() then return end EndLessMapManager.leftEnergy = BagManager.GetItemCountById(1) Log("获取背包剩余行动力" .. BagManager.GetItemCountById(1)) EndLessMapManager.isHungery() this:RefreshEnergyShow() -- 显示你有多少钱钱 this.moneyNum:GetComponent("Text").text = BagManager.GetTotalItemNum(1201) this.moneyIcon:GetComponent("Image").sprite = SetIcon(this.spLoader, 1201) this:SetShiQiValue() end -- 无尽副本中角色死翘翘 function EndLessMapView:OnRoleDead() -- this:RefreshEnergyValue(false, COST_TYPE.DEAD) -- -- 死亡退出触发事件状态 -- EndLessMapManager.isTrigger = false -- -- 看看是否是死光光了 -- if EndLessMapManager.IsAllDead() then -- PopupTipPanel.ShowTip(Language[11282]) -- this:ResetRoleState() -- end end -- 无尽副本在地图之间传送 function EndLessMapView:OnRoleTransport(func) EndLessMapManager.GetLeftEnergy(function () this:RefreshEnergyValue(false, COST_TYPE.TRANSPORT) if func then func() end end) end -- 行动力警告特效 -- function this.PlayWarnEffect() -- this.warn:SetActive(true) -- local timer = Timer.New(function () -- this.warn:SetActive(false) -- end, 1.6) -- timer:Start() -- end -- 行动力是否显示倒计时 function EndLessMapView:ShowCountTime() if this.timer then this.timer:Stop() this.timer = nil end this.actCountTime.text = "" this.bgTime:SetActive(true) this.timer = Timer.New(function () local leftTime = AutoRecoverManager.GetRecoverTime(1) if not this.isPanelClose then this.actCountTime.text = GetTimeMaoHaoStrBySeconds(math.floor(leftTime)).."后恢复1点" end end, 1, -1, true) this.timer:Start() end --- ========================================================== function EndLessMapView:OnClose() if not this:IsEndLessMap() then return end -- this.warn:SetActive(false) Util.ClearChild(this.selectHeroGrid.transform) this.heroList = {} this.isPanelClose = true EndLessMapManager.isUpdateOnClose = false if this.timer then this.timer:Stop() this.timer = nil end end function EndLessMapView:OnDestroy() this.spLoader:Destroy() if not this:IsEndLessMap() then return end ClearRedPointObject(RedPointType.wujinTreasure,this.endLessTreasureRed) ClearRedPointObject(RedPointType.wujinMission,this.btnNoteRed) end return EndLessMapView