GuideManager = {} local this = GuideManager local GuideConfig = ConfigManager.GetConfig(ConfigName.GuideConfig) local GlobalSystemConfig = ConfigManager.GetConfig(ConfigName.GlobalSystemConfig) local openDic = {} local funcDic = {} local json = require 'cjson' local _CarbonGuildList = {} local _IsFuncGuild = false local _FuncGuideList = {} --初始化 function this.Initialize() Game.GlobalEvent:AddEvent(GameEvent.FunctionCtrl.OnFunctionOpen, this.OnFunctionOpen) Game.GlobalEvent:AddEvent(GameEvent.Player.OnLevelChange, this.OnLevelChange) Game.GlobalEvent:AddEvent(GameEvent.HongMeng.HongMengGuide,this.HongMengGuideFun) end this.IsFirstOpenHarmonyBei = false function this.HongMengGuideFun(OnOff) --鸿蒙碑开启引导 print(Language[12186]) if OnOff == 1 then -- body UIManager.OpenPanel(UIName.MainPanel) table.insert(_FuncGuideList, 101612) this.CheckFuncGuide() this.IsFirstOpenHarmonyBei = true -- for i = 1, #HarmonyManager.hongmengGuards do -- -- body -- if HarmonyManager.hongmengGuards[i].heroId ~= "" then -- -- body -- local _heroData = HeroManager.GetSingleHeroData(HarmonyManager.hongmengGuards[i].heroId) -- HeroManager.UpdateSingleHeroDatas(_heroData.dynamicId, 1, _heroData.star, 0, _heroData.upStarId) -- end -- end end end function this.OnLevelChange() -- 首充引导特殊处理到十级开放 if PlayerManager.level == 10 then table.insert(_FuncGuideList, 100200) this.CheckFuncGuide() end end -- function this.OnFunctionOpen(funcId) if not funcId then return end -- LogGreen(funcId.."funcId") if not AppConst.isGuide then -- LogGreen("不在引导内") return end LogGreen(tostring(AppConst.isGuide)) local guideId = GlobalSystemConfig[funcId].GuideId if guideId and guideId ~= 0 and not funcDic[guideId] then table.insert(_FuncGuideList, guideId) end -- this.CheckFuncGuide() end -- 将引导加入引导队列 function this.TestFuncGuide(guideId) if funcDic[guideId] then funcDic[guideId] = nil end table.insert(_FuncGuideList, guideId) this.CheckFuncGuide() end -- 初始化引导数据 function this.InitData(guideData) openDic = {} funcDic = {} --this.RefreshTriggerListen(1701, 35, { 17,}) --只有勾了新手引导,才会读取引导数据,否则置为-1 if not AppConst.isGuide or PlayerManager.level == 200 then openDic[GuideType.Force] = -1 NetManager.SaveGuideDataRequest(GuideType.Force, -1) return end for i = 1, #guideData do local guide = guideData[i] -- 强制引导只保存一条当前引导数据 if guide.type == GuideType.Force then openDic[guide.type] = guide.id if guide.id ~= -1 then local openType = GuideConfig[guide.id].OpenType local openArgs = GuideConfig[guide.id].OpenArgs this.RefreshTriggerListen(guide.id, openType, openArgs) end elseif guide.type == GuideType.Check then -- 用于检测引导的网络延时不需要检测 elseif guide.type == GuideType.Function then -- 功能引导类型 不是按类型对应id的方式不需要检测 else -- 功能引导会将所有功能引导的id通过type字段保存到后端 funcDic[guide.type] = guide.id end end -- 测试功能引导用 -- Timer.New(function() -- this.OnFunctionOpen(86) -- print("6666666") -- --this.HongMengGuideFun() -- end, 1):Start() end -- 检测功能引导 function GuideManager.CheckFuncGuide() if not GuideManager.IsInMainGuide() and not _IsFuncGuild and #_FuncGuideList > 0 then local guideId = _FuncGuideList[1] if not funcDic[guideId] then this.SyncFuncGuideServer(guideId) GuideManager.ShowGuide(guideId) end table.remove(_FuncGuideList, 1) end end --- 外部调用检测副本引导的方法 function GuideManager.CheckCarbonGuild(carbonType) -- 判断当前 if CarbonManager.difficulty ~= carbonType then return end -- 判断是否时第一次进入某类型副本 if MapManager.IsPlayedByMapType(carbonType) then return end -- 设置已经进入过此类型副本(感觉放在这里不好,但是为了统一处理先放在这里) MapManager.SetMapTypePlayed(carbonType) -- 找到符合条件的引导数据 for _, config in ipairs(_CarbonGuildList) do if config.OpenArgs[1] == carbonType then this.ShowGuide(config.Id) end end end -- 获取当前引导节点 function this.GetCurId(type) return openDic[type] end --判定是否在强制引导阶段 function this.IsInMainGuide() return openDic[GuideType.Force] and openDic[GuideType.Force] ~= -1 end -- 判断功能引导是否存在 function this.IsFunctionGuideExist() return _IsFuncGuild end --更新下一步引导 function this.CheckNextGuideListen(nextId) if GuideConfig[nextId] then local type = GuideConfig[nextId].Type if openDic[type] then openDic[type] = nextId this.RefreshTriggerListen(nextId, GuideConfig[nextId].OpenType, GuideConfig[nextId].OpenArgs) end end end function this.ShowGuide(id, ...) -- 引导数据打点 DataCenterManager.CommitClickStatus(Language[10832], tostring(id)) ThinkingAnalyticsManager.Track("guild", { step_id = id, guild_start_time = math.floor(GetTimeStamp()), }) if AppConst.isSDKLogin then -- SDKMgr:NewRoleTutorial(tostring(id) ,tostring(math.floor(GetTimeStamp())) ,tostring(math.floor(GetTimeStamp())), -- PlayerManager.serverInfo.server_id,PlayerManager.serverInfo.name,PlayerManager.nickName,tostring(PlayerManager.uid)) --发送埋点数据 if id == -1 then CustomEventManager.SendCustomEvents(FBSDKCustomEventType.FinishGuide,0) end end -- 引导结束回调 local function onGuideClose() if GuideConfig[id].Type == GuideType.Force then if not this.IsInMainGuide() then -- 强制引导结束检测是否需要功能引导 this.CheckFuncGuide() end elseif GuideConfig[id].Type == GuideType.Function then -- 关闭功能引导 _IsFuncGuild = false -- 检测是否还需要功能引导 this.CheckFuncGuide() elseif GuideConfig[id].Type == GuideType.Battle then Game.GlobalEvent:DispatchEvent(GameEvent.Guide.BattleGuideDone) end end -- 监听下一步引导 if GuideConfig[id].Next ~= 0 then this.CheckNextGuideListen(GuideConfig[id].Next) end -- 开始功能引导 if GuideConfig[id].Type == GuideType.Function then _IsFuncGuild = true end -- 显示当前引导 UIManager.OpenPanel(UIName.GuidePanel, id, onGuideClose, ...) end -- 同步引导数据到服务器 function this.SyncServer(id) --同步到后端 Game.GlobalEvent:DispatchEvent(GameEvent.Guide.NextTrigger, id) if GuideConfig[id].ServerNext ~= 0 then if GuideConfig[id].Type == GuideType.Force then openDic[GuideType.Force] = GuideConfig[id].ServerNext NetManager.SaveGuideDataRequest(GuideConfig[id].Type, GuideConfig[id].ServerNext) end end end -- 检测服务器延迟, function this.CheckServer(func) NetManager.SaveGuideDataRequest(GuideType.Check, 0, func) end -- 将功能引导同步到服务器 function this.SyncFuncGuideServer(id) if GuideConfig[id].Type == GuideType.Function then funcDic[id] = 1 NetManager.SaveGuideDataRequest(id, 1) end end --更新触发监听 function this.RefreshTriggerListen(id, openType, openArgs) if openType == 1 then --进入新关卡界面 local trigger trigger = function(panelType, panel) if panelType == UIName.FightPointPassMainPanel then Game.GlobalEvent:RemoveEvent(GameEvent.UI.OnOpen, trigger) this.ShowGuide(id) end end Game.GlobalEvent:AddEvent(GameEvent.UI.OnOpen, trigger) elseif openType == 2 then --地图走格子触发 local trigger trigger = function(u, v, callList) if MapManager.curMapId == 100 and u == openArgs[1] and v == openArgs[2] then Game.GlobalEvent:RemoveEvent(GameEvent.Guide.MapPosTriggered, trigger) this.ShowGuide(id) callList:Push(function() trigger = function(panelType) if panelType == UIName.GuidePanel then Game.GlobalEvent:RemoveEvent(GameEvent.UI.OnClose, trigger) MapPanel.CallListPop() end end Game.GlobalEvent:AddEvent(GameEvent.UI.OnClose, trigger) end) end end Game.GlobalEvent:AddEvent(GameEvent.Guide.MapPosTriggered, trigger) elseif openType == 3 then --监听指定怪物组id的战斗,战斗技能触发,显示对位敌人 local trigger trigger = function(roleView) if FightPointPassManager.curOpenFight == openArgs[1] then Game.GlobalEvent:RemoveEvent(GameEvent.Guide.GuideBattleCDDone, trigger) BattleManager.PauseBattle() this.ShowGuide(id, roleView) GuidePanel.upArrow.transform.position = roleView.GameObject.transform.position local enemyView = roleView.RootPanel.GetRoleView(BattleLogic.GetAggro(roleView.role)) GuidePanel.upArrow.transform.up = Vector3.Normalize(enemyView.GameObject.transform.position - roleView.GameObject.transform.position) -- Util.GetTransform(GuidePanel.upArrow, "1").localEulerAngles = -GuidePanel.upArrow.transform.localEulerAngles GuidePanel.upArrow:SetActive(true) local canGO1 = roleView.GameObject.transform.parent.parent.gameObject:GetComponent("Canvas") local canGO2 = enemyView.GameObject.transform.parent.gameObject:GetComponent("Canvas") local canGO3 = Util.GetGameObject(roleView.RootPanel.EnemyPanel, "live_"..canGO2.name):GetComponent("Canvas") canGO1.overrideSorting = true canGO2.overrideSorting = true canGO3.overrideSorting = true canGO1.sortingOrder = GuidePanel.sortingOrder canGO2.sortingOrder = GuidePanel.sortingOrder canGO3.sortingOrder = GuidePanel.sortingOrder trigger = function(theId) if id == theId then Game.GlobalEvent:RemoveEvent(GameEvent.Guide.NextTrigger, trigger) BattleManager.ResumeBattle() GuidePanel.upArrow:SetActive(false) canGO1.overrideSorting = false canGO2.overrideSorting = false canGO3.overrideSorting = false end end Game.GlobalEvent:AddEvent(GameEvent.Guide.NextTrigger, trigger) end end Game.GlobalEvent:AddEvent(GameEvent.Guide.GuideBattleCDDone, trigger) elseif openType == 4 then --序章完成进入主界面完成触发 local trigger trigger = function(panelType, panel) if panelType == UIName.MainPanel then Game.GlobalEvent:RemoveEvent(GameEvent.UI.OnOpen, trigger) this.ShowGuide(id) end end Game.GlobalEvent:AddEvent(GameEvent.UI.OnOpen, trigger) elseif openType == 5 then --监听指定怪物组id的战斗,有敌方角色死亡时,我方对位角色技能触发 local trigger trigger = function(roleView) if FightPointPassManager.curOpenFight == openArgs[1] and roleView.RootPanel.GuideCheckEnemyDead(roleView.role) then Game.GlobalEvent:RemoveEvent(GameEvent.Guide.GuideBattleCDDone, trigger) BattleManager.PauseBattle() this.ShowGuide(id, roleView) GuidePanel.upArrow.transform.position = roleView.GameObject.transform.position local enemyView = roleView.RootPanel.GetRoleView(BattleLogic.GetAggro(roleView.role)) GuidePanel.upArrow.transform.up = Vector3.Normalize(enemyView.GameObject.transform.position - roleView.GameObject.transform.position) -- Util.GetTransform(GuidePanel.upArrow, "1").localEulerAngles = -GuidePanel.upArrow.transform.localEulerAngles GuidePanel.upArrow:SetActive(true) local canGO1 = roleView.GameObject.transform.parent.parent.gameObject:GetComponent("Canvas") local canGO2 = enemyView.GameObject.transform.parent.gameObject:GetComponent("Canvas") local canGO3 = Util.GetGameObject(roleView.RootPanel.EnemyPanel, "live_"..canGO2.name):GetComponent("Canvas") canGO1.overrideSorting = true canGO2.overrideSorting = true canGO3.overrideSorting = true canGO1.sortingOrder = GuidePanel.sortingOrder canGO2.sortingOrder = GuidePanel.sortingOrder canGO3.sortingOrder = GuidePanel.sortingOrder trigger = function(theId) if id == theId then GuidePanel.upArrow:SetActive(false) canGO1.overrideSorting = false canGO2.overrideSorting = false canGO3.overrideSorting = false end if GuideConfig[id].Next == theId then Game.GlobalEvent:RemoveEvent(GameEvent.Guide.NextTrigger, trigger) BattleManager.ResumeBattle() end end Game.GlobalEvent:AddEvent(GameEvent.Guide.NextTrigger, trigger) end end Game.GlobalEvent:AddEvent(GameEvent.Guide.GuideBattleCDDone, trigger) elseif openType == 6 then --监听指定怪物组id的战斗技能是否触发 local trigger trigger = function(roleView) if FightPointPassManager.curOpenFight == openArgs[1] then Game.GlobalEvent:RemoveEvent(GameEvent.Guide.GuideBattleCDDone, trigger) BattleManager.PauseBattle() --触发时暂停游戏逻辑 this.ShowGuide(id, roleView) local canGO1 = roleView.GameObject.transform.parent.parent.gameObject:GetComponent("Canvas") canGO1.overrideSorting = true canGO1.sortingOrder = GuidePanel.sortingOrder trigger = function(panelType) if panelType == UIName.GuidePanel then Game.GlobalEvent:RemoveEvent(GameEvent.UI.OnClose, trigger) BattleManager.ResumeBattle() canGO1.overrideSorting = false end end Game.GlobalEvent:AddEvent(GameEvent.UI.OnClose, trigger) end end Game.GlobalEvent:AddEvent(GameEvent.Guide.GuideBattleCDDone, trigger) elseif openType == 7 then --进入上阵选择界面,判定指定关卡通关 local trigger trigger = function(panelType) if panelType == UIName.FormationPanel and FightPointPassManager.curOpenFight == openArgs[1] then Game.GlobalEvent:RemoveEvent(GameEvent.UI.OnOpen, trigger) this.ShowGuide(id) end end Game.GlobalEvent:AddEvent(GameEvent.UI.OnOpen, trigger) elseif openType == 8 then --监听指定怪物组id的战斗,触发战场分割,显示战斗提示,切换到第二提示 local trigger trigger = function(stage) if FightPointPassManager.curOpenFight == openArgs[1] and stage == openArgs[2] then Game.GlobalEvent:RemoveEvent(GameEvent.Guide.GuideBattleStageChange, trigger) BattleManager.PauseBattle() --触发时暂停游戏逻辑 this.ShowGuide(id, stage) trigger = function(theId) if GuideConfig[id].Next == theId then Game.GlobalEvent:RemoveEvent(GameEvent.Guide.NextTrigger, trigger) BattleManager.ResumeBattle() end end Game.GlobalEvent:AddEvent(GameEvent.Guide.NextTrigger, trigger) end end Game.GlobalEvent:AddEvent(GameEvent.Guide.GuideBattleStageChange, trigger) elseif openType == 9 then --进入新关卡界面,判定指定关卡通关 local trigger trigger = function(panelType, panel) if panelType == UIName.FightPointPassMainPanel and FightPointPassManager.curOpenFight == openArgs[1] then Game.GlobalEvent:RemoveEvent(GameEvent.UI.OnOpen, trigger) this.ShowGuide(id) end end Game.GlobalEvent:AddEvent(GameEvent.UI.OnOpen, trigger) elseif openType == 10 then --进入单抽界面 local trigger trigger = function(panelType, panel) if panelType == UIName.SingleRecruitPanel then Game.GlobalEvent:RemoveEvent(GameEvent.UI.OnOpen, trigger) this.ShowGuide(id) end end Game.GlobalEvent:AddEvent(GameEvent.UI.OnOpen, trigger) elseif openType == 11 then --进入上阵选择界面 local trigger trigger = function(panelType) if panelType == UIName.FormationPanel then Game.GlobalEvent:RemoveEvent(GameEvent.UI.OnOpen, trigger) this.ShowGuide(id) end end Game.GlobalEvent:AddEvent(GameEvent.UI.OnOpen, trigger) elseif openType == 12 then --进入副本引导界面 local trigger trigger = function(panelType) if panelType == UIName.CarbonMissionPopup then Game.GlobalEvent:RemoveEvent(GameEvent.UI.OnOpen, trigger) this.ShowGuide(id) end end Game.GlobalEvent:AddEvent(GameEvent.UI.OnOpen, trigger) elseif openType == 13 then elseif openType == 14 then --地图点option完成触发 local trigger trigger = function(type, optionId) Log("type:" .. type) Log("optionId:" .. optionId) Log("openArgs[1]:" .. openArgs[1]) if type == 1 and optionId == openArgs[1] then Log("done!!!!!") Game.GlobalEvent:RemoveEvent(GameEvent.Map.ProgressChange, trigger) this.ShowGuide(id) end end Game.GlobalEvent:AddEvent(GameEvent.Map.ProgressChange, trigger) elseif openType == 15 then --战斗胜利结算 local trigger trigger = function(panelType) if panelType == UIName.BattleWinPopup then Game.GlobalEvent:RemoveEvent(GameEvent.UI.OnOpen, trigger) this.ShowGuide(id) end end Game.GlobalEvent:AddEvent(GameEvent.UI.OnOpen, trigger) elseif openType == 16 then --序章战开始 local trigger trigger = function(panelType) if MapManager.curMapId == 100 then Game.GlobalEvent:RemoveEvent(GameEvent.Guide.GuideBattleStart, trigger) BattleManager.PauseBattle() this.ShowGuide(id) trigger = function(panelType) if panelType == UIName.GuidePanel then Game.GlobalEvent:RemoveEvent(GameEvent.UI.OnClose, trigger) BattleManager.ResumeBattle() end end Game.GlobalEvent:AddEvent(GameEvent.UI.OnClose, trigger) end end Game.GlobalEvent:AddEvent(GameEvent.Guide.GuideBattleStart, trigger) elseif openType == 17 then --序章探索完成 local trigger trigger = function(panelType) if MapManager.curMapId == 100 and panelType == UIName.MissionRewardPanel then Game.GlobalEvent:RemoveEvent(GameEvent.UI.OnOpen, trigger) this.ShowGuide(id) end end Game.GlobalEvent:AddEvent(GameEvent.UI.OnOpen, trigger) elseif openType == 18 then --恭喜获得界面 local trigger trigger = function(panelType) if panelType == UIName.RewardItemPopup then Game.GlobalEvent:RemoveEvent(GameEvent.UI.OnOpen, trigger) this.ShowGuide(id) end end Game.GlobalEvent:AddEvent(GameEvent.UI.OnOpen, trigger) elseif openType == 19 then --监听角色升级界面 local trigger trigger = function(panelType) if panelType == UIName.RoleUpLvBreakSuccessPanel then Game.GlobalEvent:RemoveEvent(GameEvent.UI.OnClose, trigger) this.ShowGuide(id) end end Game.GlobalEvent:AddEvent(GameEvent.UI.OnClose, trigger) elseif openType == 20 then --监听地图任务界面 local trigger trigger = function(panelType) if panelType == UIName.CarbonMissionPopup then Game.GlobalEvent:RemoveEvent(GameEvent.UI.OnOpen, trigger) this.ShowGuide(id) end end Game.GlobalEvent:AddEvent(GameEvent.UI.OnOpen, trigger) elseif openType == 21 then --进入地图 local trigger trigger = function() if MapManager.curMapId == openArgs[1] then Game.GlobalEvent:RemoveEvent(GameEvent.Guide.MapInit, trigger) this.ShowGuide(id) end end Game.GlobalEvent:AddEvent(GameEvent.Guide.MapInit, trigger) -- elseif openType == 22 then -- --监听副本结算界面 -- local trigger -- trigger = function(panelType) -- if panelType == UIName.MapStatsPanel then -- Game.GlobalEvent:RemoveEvent(GameEvent.UI.OnOpen, trigger) -- this.ShowGuide(id) -- end -- end -- Game.GlobalEvent:AddEvent(GameEvent.UI.OnOpen, trigger) elseif openType == 23 then --监听副本界面 local trigger trigger = function(panelType) if panelType == UIName.CarbonTypePanel then Game.GlobalEvent:RemoveEvent(GameEvent.UI.OnOpen, trigger) this.ShowGuide(id) end end Game.GlobalEvent:AddEvent(GameEvent.UI.OnOpen, trigger) elseif openType == 24 then --恭喜获得界面弹出后 local trigger trigger = function(panelType) if panelType == UIName.RewardItemPopup then Game.GlobalEvent:RemoveEvent(GameEvent.UI.OnClose, trigger) this.ShowGuide(id) end end Game.GlobalEvent:AddEvent(GameEvent.UI.OnClose, trigger) elseif openType == 25 then --升阶完成后 local trigger trigger = function(panelType) if panelType == UIName.RoleUpStarSuccessPanel then Game.GlobalEvent:RemoveEvent(GameEvent.UI.OnClose, trigger) this.ShowGuide(id) end end Game.GlobalEvent:AddEvent(GameEvent.UI.OnClose, trigger) --elseif openType == 26 then -- --功能开启后 -- local trigger -- trigger = function(panelType) -- if panelType == UIName.MainPanel and ActTimeCtrlManager.IsQualifiled(openArgs[1]) then -- Game.GlobalEvent:RemoveEvent(GameEvent.UI.OnOpen, trigger) -- this.ShowGuide(id) -- end -- end -- Game.GlobalEvent:AddEvent(GameEvent.UI.OnOpen, trigger) elseif openType == 27 then --天赋收集完成 local trigger trigger = function(panelType) if panelType == UIName.MsgPanel then Game.GlobalEvent:RemoveEvent(GameEvent.UI.OnOpen, trigger) this.ShowGuide(id) end end Game.GlobalEvent:AddEvent(GameEvent.UI.OnOpen, trigger) elseif openType == 28 then --首次进入试炼副本 local trigger trigger = function() if MapTrialManager.firstEnter then Game.GlobalEvent:RemoveEvent(GameEvent.Guide.MapInit, trigger) this.ShowGuide(id) end end Game.GlobalEvent:AddEvent(GameEvent.Guide.MapInit, trigger) elseif openType == 29 then --工坊升级界面关闭 local trigger trigger = function(panelType) if panelType == UIName.WorkShopLevelUpNotifyPanel then Game.GlobalEvent:RemoveEvent(GameEvent.UI.OnClose, trigger) this.ShowGuide(id) end end Game.GlobalEvent:AddEvent(GameEvent.UI.OnClose, trigger) elseif openType == 30 then --击败秘境的看守 local trigger trigger = function(areaId) if areaId then Game.GlobalEvent:RemoveEvent(GameEvent.Adventure.MonsterSayInfo, trigger) this.ShowGuide(id) end end Game.GlobalEvent:AddEvent(GameEvent.Adventure.MonsterSayInfo, trigger) elseif openType == 31 then local trigger trigger = function(panelType) if panelType == UIName.ArenaMainPanel then Game.GlobalEvent:RemoveEvent(GameEvent.UI.OnOpen, trigger) this.ShowGuide(id) end end Game.GlobalEvent:AddEvent(GameEvent.UI.OnOpen, trigger) elseif openType == 32 then local trigger trigger = function(panelType) if panelType == UIName.FightEndLvUpPanel then Game.GlobalEvent:RemoveEvent(GameEvent.UI.OnClose, trigger) this.ShowGuide(id) end end Game.GlobalEvent:AddEvent(GameEvent.UI.OnClose, trigger) elseif openType == 33 then --local trigger --trigger = function(panelType) -- if panelType == UIName.TalentUpGradSuccessPanel then -- Game.GlobalEvent:RemoveEvent(GameEvent.UI.OnOpen, trigger) -- this.ShowGuide(id) -- end --end --Game.GlobalEvent:AddEvent(GameEvent.UI.OnOpen, trigger) elseif openType == 34 then --local trigger --trigger = function(panelType) -- if panelType == UIName.TalentUpGradSuccessPanel then -- Game.GlobalEvent:RemoveEvent(GameEvent.UI.OnClose, trigger) -- this.ShowGuide(id) -- end --end --Game.GlobalEvent:AddEvent(GameEvent.UI.OnClose, trigger) elseif openType == 35 then local trigger trigger = function(panelType) --close => BattlePanel if panelType == UIName.FightPointPassMainPanel then Game.GlobalEvent:RemoveEvent(GameEvent.UI.OnOpen, trigger) this.ShowGuide(id) end end Game.GlobalEvent:AddEvent(GameEvent.UI.OnOpen, trigger) elseif openType == 36 then -- 第一次进入副本触发 local trigger trigger = function(panelType) --close => BattlePanel if panelType == UIName.MapPanel then Game.GlobalEvent:RemoveEvent(GameEvent.UI.OnOpen, trigger) this.ShowGuide(id) end end Game.GlobalEvent:AddEvent(GameEvent.UI.OnOpen, trigger) end end return this