local GuideGroup_15 = class("GuideGroup_15") local mapEventConfig = {} local groupId = 15 local totalStep = 3 local current = 1 function GuideGroup_15:Init(parent, runStep) self:BindEvent() self.tabChar = {} self.parent = parent current = 1 local funName = "Step_" .. current local func = handler(self, self[funName]) func() end function GuideGroup_15:BindEvent() if type(mapEventConfig) ~= "table" then return end for nEventId, sCallbackName in pairs(mapEventConfig) do local callback = self[sCallbackName] if type(callback) == "function" then EventManager.Add(nEventId, self, callback) end end end function GuideGroup_15:UnBindEvent() if type(mapEventConfig) ~= "table" then return end for nEventId, sCallbackName in pairs(mapEventConfig) do local callback = self[sCallbackName] if type(callback) == "function" then EventManager.Remove(nEventId, self, callback) end end end function GuideGroup_15:SendGuideStep(step) self.parent:SendGuideStep(groupId, step) end function GuideGroup_15:Clear() self.runGuide = false self:UnBindEvent() self.parent = nil self.tabChar = nil end function GuideGroup_15:Step_1() self.msg = { BindIcon = "LevelMenuPanel/----SafeAreaRoot----/imgPhoneBg/PhoneContent/LevelMenu/btnResource", Size = {450, 360}, Deviation = {0, 170}, Head = "Icon/Head/head_11101", Desc = "Guide_15_1", DescDeviation = {-800, -40}, HandDeviation = {-300, 160}, HandRotation = -90, Type = GameEnum.guidetype.ForcedClick } self.parent:ActiveHide(true) current = 1 self.waitAnimTime = 0.5 if self.waitAnimTime ~= 0 then local wait = function() coroutine.yield(CS.UnityEngine.WaitForSeconds(self.waitAnimTime)) self.parent:PlayTypeMask(self.msg) end cs_coroutine.start(wait) else self.parent:PlayTypeMask(self.msg) end end function GuideGroup_15:Step_2() self.msg = { BindIcon = "LevelMenuPanel/----SafeAreaRoot----/---Resource---/svResource/Viewport/Content/btnRegion", Deviation = {0, 0}, Head = "Icon/Head/head_11101", Desc = "Guide_15_2", DescDeviation = {580, -250}, HandDeviation = {0, 230}, HandRotation = 180, Type = GameEnum.guidetype.ForcedClick } self.parent:ActiveHide(true) current = 2 self.waitAnimTime = 0.5 end function GuideGroup_15:Step_3() self.msg = { BindIcon = "LevelMenuPanel/----SafeAreaRoot----/imgPhoneBg/PhoneContent/SecondMenu/Resource/btnResourceGoto", Size = {870, 410}, Deviation = {0, 140}, Head = "Icon/Head/head_11101", HandDeviation = {0, 450}, HandRotation = 180, Type = GameEnum.guidetype.ForcedClick } self.parent:ActiveHide(true) current = 3 self.waitAnimTime = 0.1 end function GuideGroup_15:FinishCurrentStep() self.msg = nil self.openPanelId = nil self.waitAinEnd = nil self.runGuide = false self.waitAnimTime = 0 if current < totalStep then self:SendGuideStep(current) elseif current == totalStep then self:SendGuideStep(-1) self.parent:ClearCurGuide(true) return end local funName = "Step_" .. current + 1 local func = handler(self, self[funName]) func() if self.openPanelId == nil and self.waitAnimTime ~= 0 then local wait = function() coroutine.yield(CS.UnityEngine.WaitForSeconds(self.waitAnimTime + 0.2)) self.parent:PlayTypeMask(self.msg) end cs_coroutine.start(wait) end end return GuideGroup_15