【战斗】跳过按钮进度显示优化

dev_chengFeng
gaoxin 2021-11-26 19:41:10 +08:00
parent 83946b29f2
commit 060a380305
2 changed files with 94 additions and 5 deletions

View File

@ -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}

View File

@ -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