diff --git a/Assets/ManagedResources/~Lua/Common/GlobalDefine.lua b/Assets/ManagedResources/~Lua/Common/GlobalDefine.lua index a349ada01a..e6a34fbc4a 100644 --- a/Assets/ManagedResources/~Lua/Common/GlobalDefine.lua +++ b/Assets/ManagedResources/~Lua/Common/GlobalDefine.lua @@ -2358,7 +2358,7 @@ WALK_DIR = { PLAYER_WALK_DIR = { --没有坐骑的时候 IDLE = {animation = "idle", y = 0}, - IDLEBACK = {animation = "idle", y = 180}, + IDLEBACK = {animation = "idle3", y = 0}, JINGYA = {animation = "jingya", y = 0}, LAUCH = {animation = "lauch", y = 0}, TOUCH = {animation = "touch", y = 0}, diff --git a/Assets/ManagedResources/~Lua/Modules/Guide/GuideManager.lua b/Assets/ManagedResources/~Lua/Modules/Guide/GuideManager.lua index ac202f8688..170ec5be67 100644 --- a/Assets/ManagedResources/~Lua/Modules/Guide/GuideManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/Guide/GuideManager.lua @@ -44,6 +44,7 @@ function this.OnLevelChange() -- 首充引导特殊处理到十级开放 if PlayerManager.level == 10 then table.insert(_FuncGuideList, 100200) + StoryMapManager.isShowStory = true this.CheckFuncGuide() end end @@ -112,6 +113,8 @@ end -- 检测功能引导 function GuideManager.CheckFuncGuide() + for k,v in pairs(funcDic) do + end if not GuideManager.IsInMainGuide() and not _IsFuncGuild and #_FuncGuideList > 0 then local guideId = _FuncGuideList[1] if not funcDic[guideId] then diff --git a/Assets/ManagedResources/~Lua/Modules/Guide/GuidePanel.lua b/Assets/ManagedResources/~Lua/Modules/Guide/GuidePanel.lua index 20db866031..684e570194 100644 --- a/Assets/ManagedResources/~Lua/Modules/Guide/GuidePanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/Guide/GuidePanel.lua @@ -411,9 +411,7 @@ function this.ExecuteBehavior(beType, beArgs) local panel = c[1] local nextId = c[2] if id == panel and UIManager.IsTopShow(panel) then - this.NextGuide(nextId) - Game.GlobalEvent:RemoveEvent(GameEvent.UI.OnOpen, OnFocus) - Game.GlobalEvent:RemoveEvent(GameEvent.UI.OnFocus, OnFocus) + this.ShowStory(nextId,OnFocus) return end end @@ -475,6 +473,41 @@ function this.ExecuteBehavior(beType, beArgs) end end +function this.ShowStory(nextId,OnFocus) + if StoryMapManager.isShowStory then + StoryMapManager.isShowStory = false + local isShowStory = 1 + if PlayerPrefs.HasKey("StoryMapPanel1"..PlayerManager.uid) then + isShowStory = PlayerPrefs.GetInt("StoryMapPanel"..PlayerManager.uid) + end + if isShowStory == 1 then + LogGreen("this.gameObject:"..this.gameObject.name) + this.gameObject:SetActive(false) + Game.GlobalEvent:AddEvent(GameEvent.GuaJi.CloseStoryMapPanel,function() + this.GameSetActive(nextId,OnFocus) + end) + PlayerPrefs.SetInt("StoryMapPanel1"..PlayerManager.uid,0) + StoryMapManager.InitData(1) + else + this.NextGuide(nextId) + Game.GlobalEvent:RemoveEvent(GameEvent.UI.OnOpen, OnFocus) + Game.GlobalEvent:RemoveEvent(GameEvent.UI.OnFocus, OnFocus) + end + else + this.NextGuide(nextId) + Game.GlobalEvent:RemoveEvent(GameEvent.UI.OnOpen, OnFocus) + Game.GlobalEvent:RemoveEvent(GameEvent.UI.OnFocus, OnFocus) + end +end + +function this.GameSetActive(nextId,OnFocus) + this.gameObject:SetActive(true) + Game.GlobalEvent:RemoveEvent(GameEvent.GuaJi.CloseStoryMapPanel,this.GameSetActive) + this.NextGuide(nextId) + Game.GlobalEvent:RemoveEvent(GameEvent.UI.OnOpen, OnFocus) + Game.GlobalEvent:RemoveEvent(GameEvent.UI.OnFocus, OnFocus) +end + function this.ShowGuide(id) this.id = id this.gameObject:GetComponent("Image").raycastTarget = true diff --git a/Assets/ManagedResources/~Lua/Modules/Story/StoryMapManager.lua b/Assets/ManagedResources/~Lua/Modules/Story/StoryMapManager.lua index 14895d7ef0..5cac837a41 100644 --- a/Assets/ManagedResources/~Lua/Modules/Story/StoryMapManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/Story/StoryMapManager.lua @@ -1,6 +1,7 @@ StoryMapManager = {} local this = StoryMapManager this.groupConfigs = {} +this.isShowStory = false local storyMapConfig = ConfigManager.GetConfig(ConfigName.StoryMapConfig) --初始化 function this.Initialize() diff --git a/Assets/ManagedResources/~Lua/Modules/Story/StoryMapPanel.lua b/Assets/ManagedResources/~Lua/Modules/Story/StoryMapPanel.lua index 4f646a1737..15f6924006 100644 --- a/Assets/ManagedResources/~Lua/Modules/Story/StoryMapPanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/Story/StoryMapPanel.lua @@ -13,6 +13,8 @@ this.eventIndex = 0 this.showDiaLog = false local lastLive2DId = 0 +local sortingOrder = 0 +local newSortingOrder = 0 --初始化组件(用于子类重写) function StoryMapPanel:InitComponent() this.map = Util.GetGameObject(self.gameObject,"bg/mapParent") @@ -73,6 +75,7 @@ end --界面打开时调用(用于子类重写) function StoryMapPanel:OnOpen(config) + sortingOrder = 0 this.PlayerGrouops = {} this.triggerEvent = {} curGroupConfig = config @@ -142,23 +145,12 @@ function StoryMapPanel:OnShow() end function this:StackPop() - -- local isEnterNext = true - -- for k,v in pairs(this.PlayerGrouops) do - -- if v.state == 1 then - -- isEnterNext = false - -- break - -- end - -- end - -- if isEnterNext then - LogGreen("前:"..this.callList:Count()) - if this.callList:Count() > 0 then - this.callList:Pop()() - LogGreen("后:"..this.callList:Count()) - else - LogGreen("进入下一场景") - StoryMapManager.GetSingleStoryConfig() - end - --end + if this.callList:Count() > 0 then + this.callList:Pop()() + else + sortingOrder = newSortingOrder + StoryMapManager.GetSingleStoryConfig() + end end function this:CheckTrigger(data,go) @@ -169,40 +161,126 @@ function this:CheckTrigger(data,go) this:ShowDialog() elseif data.eventType == 2 then this.eventIndex = 0 - this:RunMap() + this:RunMap(data.eventType) elseif data.eventType == 3 then this.eventIndex = 0 --PopupTipPanel.ShowTip("进入一场假战斗") this:EnterFight() elseif data.eventType == 4 then --符咒闪烁了一下 this.eventIndex = 0 - PopupTipPanel.ShowTip("符咒闪烁了一下") - this:StackPop() + --PopupTipPanel.ShowTip("符咒闪烁了一下") + -- this:StackPop() + if not this.UI_Effect_ChuFaEffect_04 then + this.UI_Effect_ChuFaEffect_04 = poolManager:LoadAsset("UI_Effect_ChuFaEffect_04", PoolManager.AssetType.GameObject) + this.UI_Effect_ChuFaEffect_04.name = "UI_Effect_ChuFaEffect_04" + this.UI_Effect_ChuFaEffect_04.transform:SetParent(this.effectRoot.transform) + this.UI_Effect_ChuFaEffect_04.transform.localPosition = Vector3.New(0,550,0) + this.UI_Effect_ChuFaEffect_04.transform.localScale = Vector3.one + end + this.UI_Effect_ChuFaEffect_04.gameObject:SetActive(true) + Util.AddParticleSortLayer(this.UI_Effect_ChuFaEffect_04,newSortingOrder - sortingOrder) + Timer.New(function() + this.UI_Effect_ChuFaEffect_04.gameObject:SetActive(false) + this:StackPop() + end,data.groups[1],1,false):Start() elseif data.eventType == 5 then --符咒闪烁后消失 this.eventIndex = 0 - PopupTipPanel.ShowTip("符咒闪烁后消失") + if this.Maps and this.Maps[2] then + this.Maps[2].gameObject:SetActive(false) + end this:StackPop() elseif data.eventType == 6 then --符咒消失,金箍棒砸在主角和怪物中间。 this.eventIndex = 0 - PopupTipPanel.ShowTip("符咒消失,金箍棒砸在主角和怪物中间。") + if not this.UI_Effect_ChuFaEffect_01 then + this.UI_Effect_ChuFaEffect_01 = poolManager:LoadAsset("UI_Effect_ChuFaEffect_01", PoolManager.AssetType.GameObject) + this.UI_Effect_ChuFaEffect_01.name = "UI_Effect_ChuFaEffect_01" + this.UI_Effect_ChuFaEffect_01.transform:SetParent(this.effectRoot.transform) + this.UI_Effect_ChuFaEffect_01.transform.localPosition = Vector3.zero + this.UI_Effect_ChuFaEffect_01.transform.localScale = Vector3.one + end + Util.AddParticleSortLayer(this.UI_Effect_ChuFaEffect_01,newSortingOrder - sortingOrder) + this.UI_Effect_ChuFaEffect_01.gameObject:SetActive(true) + Timer.New(function() + this.UI_Effect_ChuFaEffect_01.gameObject:SetActive(false) + end,data.groups[1],1,false):Start() this:StackPop() + --PopupTipPanel.ShowTip("符咒消失,金箍棒砸在主角和怪物中间。") + -- this:StackPop() elseif data.eventType == 7 then this.eventIndex = 0 - PopupTipPanel.ShowTip("随着光芒闪烁,一把从天而降的神剑插在了一只怪物面前。") - this:StackPop() + --PopupTipPanel.ShowTip("随着光芒闪烁,一把从天而降的神剑插在了一只怪物面前。") + if not this.UI_Effect_ChuFaEffect_02 then + this.UI_Effect_ChuFaEffect_02 = poolManager:LoadAsset("UI_Effect_ChuFaEffect_02", PoolManager.AssetType.GameObject) + this.UI_Effect_ChuFaEffect_02.name = "UI_Effect_ChuFaEffect_02" + this.UI_Effect_ChuFaEffect_02.transform:SetParent(this.effectRoot.transform) + this.UI_Effect_ChuFaEffect_02.transform.localPosition = Vector3.zero + this.UI_Effect_ChuFaEffect_02.transform.localScale = Vector3.one + end + if not this.UI_Effect_ChuFaEffect_05 then + this.UI_Effect_ChuFaEffect_05 = poolManager:LoadAsset("UI_Effect_ChuFaEffect_05", PoolManager.AssetType.GameObject) + this.UI_Effect_ChuFaEffect_05.name = "UI_Effect_ChuFaEffect_05" + this.UI_Effect_ChuFaEffect_05.transform:SetParent(this.effectRoot.transform) + this.UI_Effect_ChuFaEffect_05.transform.localPosition = Vector3.zero + this.UI_Effect_ChuFaEffect_05.transform.localScale = Vector3.one + end + Util.AddParticleSortLayer(this.UI_Effect_ChuFaEffect_02,newSortingOrder - sortingOrder) + Util.AddParticleSortLayer(this.UI_Effect_ChuFaEffect_05,newSortingOrder - sortingOrder) + this.UI_Effect_ChuFaEffect_02.gameObject:SetActive(true) + this.UI_Effect_ChuFaEffect_05.gameObject:SetActive(true) + Timer.New(function() + this.UI_Effect_ChuFaEffect_02.gameObject:SetActive(false) + this.UI_Effect_ChuFaEffect_05.gameObject:SetActive(false) + this:StackPop() + end,data.groups[1],1,false):Start() + --this:StackPop() elseif data.eventType == 8 then this.eventIndex = 0 - PopupTipPanel.ShowTip("数把飞剑在主角身边依次落下,将身边一圈的怪物都扎死在剑下。随后剑放出光芒,形成环绕主角的法阵。") - this:StackPop() + --PopupTipPanel.ShowTip("数把飞剑在主角身边依次落下,将身边一圈的怪物都扎死在剑下。随后剑放出光芒,形成环绕主角的法阵。") + -- this:StackPop() + if not this.effectBrowList then + this.effectBrowList = {} + end + for i = 1, 8 do + if not this.effectBrowList[i] then + this.effectBrowList[i] = poolManager:LoadAsset("UI_Effect_ChuFaEffect_05", PoolManager.AssetType.GameObject) + this.effectBrowList[i].name = "UI_Effect_ChuFaEffect_05" + this.effectBrowList[i].transform:SetParent(this.effectRoot.transform) + this.effectBrowList[i].transform.localPosition = Vector3.zero + this.effectBrowList[i].transform.localScale = Vector3.one + this.effectBrowList[i].gameObject:SetActive(false) + end + end + local indexTemp = 0 + Timer.New(function() + indexTemp = indexTemp + 1 + Util.AddParticleSortLayer(this.effectBrowList[indexTemp],newSortingOrder - sortingOrder) + this.effectBrowList[indexTemp].gameObject:SetActive(true) + end,data.groups[1],8,false):Start() + Timer.New(function() + for i = 1 ,#this.effectBrowList do + this.effectBrowList[i].gameObject:SetActive(false) + end + if not this.UI_Effect_ChuFaEffect_03 then + this.UI_Effect_ChuFaEffect_03 = poolManager:LoadAsset("UI_Effect_ChuFaEffect_03", PoolManager.AssetType.GameObject) + this.UI_Effect_ChuFaEffect_03.name = "UI_Effect_ChuFaEffect_03" + this.UI_Effect_ChuFaEffect_03.transform:SetParent(this.effectRoot.transform) + this.UI_Effect_ChuFaEffect_03.transform.localPosition = Vector3.zero + this.UI_Effect_ChuFaEffect_03.transform.localScale = Vector3.one + end + Util.AddParticleSortLayer(this.UI_Effect_ChuFaEffect_03,newSortingOrder - sortingOrder) + this.UI_Effect_ChuFaEffect_03.gameObject:SetActive(true) + Timer.New(function() + this:StackPop() + end,data.groups[3],1,false):Start() + end,data.groups[2],1,false):Start() elseif data.eventType == 9 then --等待几秒 this.eventIndex = 0 - LogGreen("data.groups[1]:"..data.groups[1]) Timer.New(function() this:StackPop() end,data.groups[1],1,false):Start() elseif data.eventType == 10 then --保持某方向移动 this.eventIndex = 0 - this:RunMap() + this:RunMap(data.eventType) end end @@ -313,14 +391,14 @@ function this.ReSetLive2d() Util.ClearChild(this.right2dRoot.transform) end -function this:RunMap() +function this:RunMap(indexType) if this.startTimer then this.startTimer:Stop() this.startTimer = nil end this.startTimer = Timer.New(function () for k,v in pairs(this.PlayerGrouops) do - v:RunMap() + v:RunMap(indexType) end end,0.1) this.startTimer:Start() @@ -352,7 +430,7 @@ function this:RunMap() end function StoryMapPanel:OnSortingOrderChange() - + newSortingOrder = self.sortingOrder end --界面关闭时调用(用于子类重写) @@ -366,6 +444,10 @@ function StoryMapPanel:OnClose() this.startTimer = nil end lastLive2DId = 0 + this.showDiaLog = false + this.dialog.gameObject:SetActive(false) + this.GoOn.gameObject:SetActive(false) + this.showImg:SetActive(false) this.ReSetLive2d() this.callList:Clear() this.triggerEvent = {} @@ -378,6 +460,33 @@ function StoryMapPanel:OnClose() this.startTimer1 = nil end this.map.transform.localPosition = Vector3.New(0,0,0) + if this.effectBrowList then + for i = 1 ,#this.effectBrowList do + this.effectBrowList[i].gameObject:SetActive(false) + poolManager:UnLoadAsset(this.effectBrowList[i].name, this.effectBrowList[i], PoolManager.AssetType.GameObject) + end + this.effectBrowList = nil + end + if this.UI_Effect_ChuFaEffect_01 then + poolManager:UnLoadAsset("UI_Effect_ChuFaEffect_01", this.UI_Effect_ChuFaEffect_01, PoolManager.AssetType.GameObject) + this.UI_Effect_ChuFaEffect_01 = nil + end + if this.UI_Effect_ChuFaEffect_02 then + poolManager:UnLoadAsset("UI_Effect_ChuFaEffect_02", this.UI_Effect_ChuFaEffect_02, PoolManager.AssetType.GameObject) + this.UI_Effect_ChuFaEffect_02 = nil + end + if this.UI_Effect_ChuFaEffect_03 then + poolManager:UnLoadAsset("UI_Effect_ChuFaEffect_03", this.UI_Effect_ChuFaEffect_03, PoolManager.AssetType.GameObject) + this.UI_Effect_ChuFaEffect_03 = nil + end + if this.UI_Effect_ChuFaEffect_04 then + poolManager:UnLoadAsset("UI_Effect_ChuFaEffect_04", this.UI_Effect_ChuFaEffect_04, PoolManager.AssetType.GameObject) + this.UI_Effect_ChuFaEffect_04 = nil + end + if this.UI_Effect_ChuFaEffect_05 then + poolManager:UnLoadAsset("UI_Effect_ChuFaEffect_05", this.UI_Effect_ChuFaEffect_05, PoolManager.AssetType.GameObject) + this.UI_Effect_ChuFaEffect_05 = nil + end end --界面销毁时调用(用于子类重写) diff --git a/Assets/ManagedResources/~Lua/View/SingleStoryPlayerView.lua b/Assets/ManagedResources/~Lua/View/SingleStoryPlayerView.lua index d8306c19a1..8b23eda0ad 100644 --- a/Assets/ManagedResources/~Lua/View/SingleStoryPlayerView.lua +++ b/Assets/ManagedResources/~Lua/View/SingleStoryPlayerView.lua @@ -74,12 +74,12 @@ function SingleStoryPlayerView:SetRoads0(data) table.insert(self.roadsList[index],road) end end - for k,v in ipairs(self.roadsList) do - LogGreen("Monster k:"..k.." dirList:"..self.dirList[k]) - for n,m in ipairs(v) do - LogGreen("Monster k:"..k.." n:"..n.." vec:"..tostring(m.vec)) - end - end + -- for k,v in ipairs(self.roadsList) do + -- LogGreen("Monster k:"..k.." dirList:"..self.dirList[k]) + -- for n,m in ipairs(v) do + -- LogGreen("Monster k:"..k.." n:"..n.." vec:"..tostring(m.vec)) + -- end + -- end self.startPos = self.roadsList[1][1].vec local pointId = tonumber(data[1]) self.playerLiveView = MonsterLiveView:New(self.roleRoot,pointId) @@ -123,17 +123,17 @@ function SingleStoryPlayerView:SetRoads1(data) table.insert(self.roadsList[index],road) end end - for k,v in ipairs(self.roadsList) do - LogGreen("Player k:"..k.." dirList:"..self.dirList[k]) - for n,m in ipairs(v) do - LogGreen("Player k:"..k.." n:"..n.." vec:"..tostring(m.vec)) - end - end + -- for k,v in ipairs(self.roadsList) do + -- LogGreen("Player k:"..k.." dirList:"..self.dirList[k]) + -- for n,m in ipairs(v) do + -- LogGreen("Player k:"..k.." n:"..n.." vec:"..tostring(m.vec)) + -- end + -- end self.startPos = self.roadsList[1][1].vec self:SetWalkDir(self.dirList[1]) end -function SingleStoryPlayerView:RunMap() +function SingleStoryPlayerView:RunMap(isSetRoleDir) self.roadsIndex = 0 self.state = 1 self.index = self.index + 1 @@ -152,7 +152,13 @@ function SingleStoryPlayerView:RunMap() if data.indexType == 2 then go = self.parent.map end - local dis = math.abs(self:SetRoleDirAction(data.vec,go,data.indexType)) + local dis + LogGreen("isSetRoleDir:"..isSetRoleDir) + if data.indexType == 2 or isSetRoleDir == 10 then + dis = math.abs(self:SetRoleDirAction(data.vec,go,false)) + else + dis = math.abs(self:SetRoleDirAction(data.vec,go,true)) + end local speed = 0 if data.indexType ~= 0 then speed = (1/600)*dis @@ -179,28 +185,28 @@ function SingleStoryPlayerView:SetRoleDirAction(pos,go,indexType) local du = pos.x - go.transform.localPosition.x local dy = pos.y - go.transform.localPosition.y if du > 0 then - if indexType ~= 2 then + if indexType then self:SetWalkDir(WALK_DIR.RUN_RIGHT) + self.eventpoint = 4 end - self.eventpoint = 4 return du elseif du < 0 then - if indexType ~= 2 then + if indexType then self:SetWalkDir(WALK_DIR.RUN_LEFT) + self.eventpoint = 3 end - self.eventpoint = 3 return du elseif dy < 0 then - if indexType ~= 2 then + if indexType then self:SetWalkDir(WALK_DIR.RUN_DOWN) + self.eventpoint = 1 end - self.eventpoint = 1 return dy elseif dy > 0 then - if indexType ~= 2 then + if indexType then self:SetWalkDir(WALK_DIR.RUN_UP) + self.eventpoint = 2 end - self.eventpoint = 2 return dy end return 0