From 7498b4dc0105fbe095cb593d01ed2de3532f2eda Mon Sep 17 00:00:00 2001 From: yuanshuai <243578945@qq.com> Date: Fri, 16 Oct 2020 15:39:48 +0800 Subject: [PATCH] =?UTF-8?q?=E8=84=9A=E6=9C=AC=E9=A0=90=E8=A8=AD=E6=8F=90?= =?UTF-8?q?=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Prefabs/UI/XiaoYao/XiaoYaoMapPanel.prefab | 14 ++++---- .../~Lua/Modules/XiaoYao/XiaoYaoMapPanel.lua | 33 +++++++++++-------- 2 files changed, 27 insertions(+), 20 deletions(-) diff --git a/Assets/ManagedResources/Prefabs/UI/XiaoYao/XiaoYaoMapPanel.prefab b/Assets/ManagedResources/Prefabs/UI/XiaoYao/XiaoYaoMapPanel.prefab index e54a3a8ab8..04561d9aa1 100644 --- a/Assets/ManagedResources/Prefabs/UI/XiaoYao/XiaoYaoMapPanel.prefab +++ b/Assets/ManagedResources/Prefabs/UI/XiaoYao/XiaoYaoMapPanel.prefab @@ -30,12 +30,12 @@ RectTransform: m_Children: - {fileID: 604031028} - {fileID: 962210698} - m_Father: {fileID: 6594538752966121076} - m_RootOrder: 1 + m_Father: {fileID: 7906550627918467978} + m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 1} - m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 339, y: -564.9} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 100, y: 100} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &38005695 @@ -1938,7 +1938,8 @@ RectTransform: m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] + m_Children: + - {fileID: 38005694} m_Father: {fileID: 6594538752966121076} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} @@ -2434,7 +2435,6 @@ RectTransform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - {fileID: 7906550627918467978} - - {fileID: 38005694} m_Father: {fileID: 1553045991312230259} m_RootOrder: 4 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} diff --git a/Assets/ManagedResources/~Lua/Modules/XiaoYao/XiaoYaoMapPanel.lua b/Assets/ManagedResources/~Lua/Modules/XiaoYao/XiaoYaoMapPanel.lua index 2d851566a8..e3b570b590 100644 --- a/Assets/ManagedResources/~Lua/Modules/XiaoYao/XiaoYaoMapPanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/XiaoYao/XiaoYaoMapPanel.lua @@ -8,6 +8,7 @@ local allGridData={} local isAuto=false local priThread = nil local itemConfig = ConfigManager.GetConfig(ConfigName.ItemConfig) +local saiNum=1 --骰子数量 --初始化组件(用于子类重写) function this:InitComponent() @@ -24,7 +25,7 @@ function this:InitComponent() this.mapParent=Util.GetGameObject(self.gameObject,"mapParent") this.gridParent=Util.GetGameObject(self.gameObject,"mapParent/gridParent") this.grid=Util.GetGameObject(self.gameObject,"prefab/grid") - this.eventPoint=Util.GetGameObject(self.gameObject,"prefab/eventPoint") + --this.eventPoint=Util.GetGameObject(self.gameObject,"prefab/eventPoint") this.startBtn=Util.GetGameObject(self.gameObject,"startBtn") this.TT=Util.GetGameObject(self.gameObject,"mapParent/TT") this.mapY=this.mapParent.transform.localPosition.y @@ -145,10 +146,7 @@ function this.StopAuto() end --事件触发处理 function this.EventTrigger(_data) - if priThread then - coroutine.stop(priThread) - priThread = nil - end + Util.GetGameObject(this.gridParent.transform:GetChild(curGridIndex-1).gameObject,"eventPoint"):SetActive(false) Log("触发事件类型为:".._data.pathType) if _data.pathType==0 then --普通节点 @@ -158,11 +156,8 @@ function this.EventTrigger(_data) PopupTipPanel.ShowTip("奖励翻倍!") elseif _data.pathType==3 then --额外骰子节点 PopupTipPanel.ShowTip("骰子x2") + saiNum=2 elseif _data.pathType==4 then --招募英雄节点 - priThread = coroutine.start(function() - coroutine.wait(1) - - end) local temp = XiaoYaoManager.GetHeroDatas() if temp and #temp > 0 then this.shopBtn:SetActive(true) @@ -198,6 +193,14 @@ function this.EventTrigger(_data) end PopupText(content, 0.5, 2) end + if priThread then + coroutine.stop(priThread) + priThread = nil + end + priThread = coroutine.start(function() + coroutine.wait(1) + + end) end --界面打开时调用(用于子类重写) function this:OnOpen(_mapData) @@ -228,10 +231,12 @@ function this:OnOpen(_mapData) local obj=this.gridParent.transform:GetChild(i-1) if i1 then --骰子x2 - -- body + saiNum=mapData.diceNum end if XiaoYaoManager.luckyluckyTurnTableTimes > 0 and (XiaoYaoManager.luckyluckyTurnTableRemainTime - PlayerManager.serverTime > 0) then this.rouleBtn:SetActive(true)