From 060a380305da4663d36e1d5dff167bddb24d87a0 Mon Sep 17 00:00:00 2001 From: gaoxin Date: Fri, 26 Nov 2021 19:41:10 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E6=88=98=E6=96=97=E3=80=91=E8=B7=B3?= =?UTF-8?q?=E8=BF=87=E6=8C=89=E9=92=AE=E8=BF=9B=E5=BA=A6=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Prefabs/UI/Battle/BattlePanel.prefab | 75 +++++++++++++++++++ .../~Lua/Modules/Battle/View/BattlePanel.lua | 24 ++++-- 2 files changed, 94 insertions(+), 5 deletions(-) diff --git a/Assets/ManagedResources/Prefabs/UI/Battle/BattlePanel.prefab b/Assets/ManagedResources/Prefabs/UI/Battle/BattlePanel.prefab index db5e817504..c53c8d3fbc 100644 --- a/Assets/ManagedResources/Prefabs/UI/Battle/BattlePanel.prefab +++ b/Assets/ManagedResources/Prefabs/UI/Battle/BattlePanel.prefab @@ -128443,6 +128443,80 @@ MonoBehaviour: m_FillClockwise: 1 m_FillOrigin: 0 m_UseSpriteMesh: 0 +--- !u!1 &4497568689648186887 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2669814021149086866} + - component: {fileID: 1181496275328126623} + - component: {fileID: 1120362570389537013} + m_Layer: 5 + m_Name: lock_round + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!224 &2669814021149086866 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4497568689648186887} + 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: 0} + m_Children: [] + m_Father: {fileID: 3994331577905171257} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: 0, y: -0.000030517578} + m_SizeDelta: {x: 85, y: 85} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &1181496275328126623 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4497568689648186887} + m_CullTransparentMesh: 0 +--- !u!114 &1120362570389537013 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4497568689648186887} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0, g: 0, b: 0, a: 0.78039217} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: 7b68ee909daf953448864a4ff3ac3e71, type: 3} + m_Type: 3 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 0 + m_FillOrigin: 2 + m_UseSpriteMesh: 0 --- !u!1 &4524878136688659169 GameObject: m_ObjectHideFlags: 0 @@ -179388,6 +179462,7 @@ RectTransform: m_Children: - {fileID: 4685898274264155040} - {fileID: 463885800620499347} + - {fileID: 2669814021149086866} m_Father: {fileID: 8285412012016129936} m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/View/BattlePanel.lua b/Assets/ManagedResources/~Lua/Modules/Battle/View/BattlePanel.lua index 0e6acf195d..c2ebaaa4d8 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/View/BattlePanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/View/BattlePanel.lua @@ -17,6 +17,8 @@ local fightType -- 1关卡 2副本 3限时怪, 5兽潮, 6新关卡, 7公会boss local orginLayer local boxList={}--新将来袭奖励盒子 local boxList2={}--踏碎凌霄奖励盒子 +local _NO_JUMP_ROUND = 2 + -- 显示跳过战斗使用 local hadCounted = 0 @@ -54,7 +56,7 @@ local UpdateBtnGMFunc = { -- if FightPointPassManager.GetCurOpenFightIdIsBoss() then -- return SKIP_STATE.NOUSE, "首领关卡无法跳过!" -- end - if this.curRound < 3 then + if this.curRound <= _NO_JUMP_ROUND then return SKIP_STATE.NOUSE, "第二回合结束后可以跳过" end return SKIP_STATE.UNLOCK @@ -66,7 +68,7 @@ local UpdateBtnGMFunc = { -- if FightPointPassManager.GetCurOpenFightIdIsBoss() then -- return SKIP_STATE.NOUSE, "首领关卡无法跳过!" -- end - if this.curRound < 3 then + if this.curRound <= _NO_JUMP_ROUND then return SKIP_STATE.NOUSE, "第二回合结束后可以跳过" end return SKIP_STATE.UNLOCK @@ -103,7 +105,8 @@ function this:InitComponent() this.BtnTimeScale = Util.GetGameObject(this.DownRoot, "option/BtnTimeScale") this.BtnJumpFight = Util.GetGameObject(this.DownRoot, "option/Button") - this.jumpLock = Util.GetGameObject(this.DownRoot, "option/Button/lock") + this.jumpLock = Util.GetGameObject(this.DownRoot, "option/Button/lock_round") + this.jumpLock:GetComponent("Image").fillAmount = 1 this.submit = Util.GetGameObject(this.DownRoot, "bg") @@ -238,6 +241,8 @@ function this:OnOpen(_fightData, _fightType, _endFunc, _guideType,isChangeBGM) fightType = _fightType --判定战斗类型 isBack = _fightType == BATTLE_TYPE.BACK --判定是否是战斗回放 hadCounted = 0 + -- + this.curRound = 1 -- LogPink(fightType) if _fightData.bg then this.BG:GetComponent("Image").sprite = this.spLoader:LoadSprite(_fightData.bg) @@ -389,8 +394,14 @@ end -- 设置跳过按钮的状态 function this.SetJumpBtnState() local state, tip = this:GetSkipState() - this.jumpLock:SetActive(state == SKIP_STATE.LOCK) - Util.SetColor(this.BtnJumpFight, state == SKIP_STATE.NOUSE and UIColor.DEEPGRAY or UIColor.WRITE) + local isLock = state ~= SKIP_STATE.UNLOCK + -- 战斗跳过按钮显示 + this.jumpLock:SetActive(isLock) + if isLock then + + local filter = 1 - (this.curRound - 1)/_NO_JUMP_ROUND + this.jumpLock:GetComponent("Image").fillAmount = filter > 0 and filter or 0 + end end @@ -744,6 +755,9 @@ end -- 角色轮转回调 function this.RoleTurnChange(role) GuideBattleLogic:RoleTurnChange(this.curRound, role) + + -- 设置跳过按钮的状态 + -- this.SetJumpBtnState() end