From 49701bcbec508acb7b6a1673d06bc20284e2ec40 Mon Sep 17 00:00:00 2001 From: ZhangBiao Date: Mon, 15 Mar 2021 18:37:16 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E9=A6=96=E9=A2=86=E6=9D=A5=E8=A2=AD?= =?UTF-8?q?=E3=80=91=E6=88=98=E6=96=97=E6=8A=A5=E9=94=99=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../~Lua/Modules/Battle/View/BattleView.lua | 40 +++++++++++-------- 1 file changed, 23 insertions(+), 17 deletions(-) diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/View/BattleView.lua b/Assets/ManagedResources/~Lua/Modules/Battle/View/BattleView.lua index de71e6d9de..f9be0ab35a 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/View/BattleView.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/View/BattleView.lua @@ -406,7 +406,7 @@ function this.ClearBattleEvent() end --敌军出现的表现 -function this.EnemyAppear() +function this.EnemyAppear(isStart) SoundManager.PlaySound(SoundConfig.Sound_BattleStart_03) local go = this.FirstEffect go:SetActive(true) @@ -437,14 +437,15 @@ function this.EnemyAppear() enemyHP = 0 this.EnemyHPTxt.text = Language[10231]..math.floor(enemyHP / enemyMaxHP * 100).."%" - - Timer.New(function () - if BattleLogic.CurOrder == 1 then - BattleManager.StartBattle() - else - BattleManager.ResumeBattle() - end - end, 0.1):Start() + if isStart then + Timer.New(function () + if BattleLogic.CurOrder == 1 then + BattleManager.StartBattle() + else + BattleManager.ResumeBattle() + end + end, 0.1):Start() + end if BattleLogic.CurOrder == 1 then Game.GlobalEvent:DispatchEvent(GameEvent.Guide.GuideBattleStart) @@ -536,7 +537,7 @@ function this.BattleOrderChange(order) end PlayUIAnim(this.gameObject) - this.EnemyAppear() + this.EnemyAppear(true) end) else this.UpRoot:SetActive(false) @@ -548,7 +549,7 @@ function this.BattleOrderChange(order) playerMaxHP = 0 this.PlayerPanel:SetActive(true) PlayUIAnim(this.PlayerPanel) - this.EnemyAppear()--设置敌人 + BattleLogic.InitOrder()--初始显示双方英雄 local func = function ()--显示英雄信息后的战斗逻辑 @@ -562,15 +563,19 @@ function this.BattleOrderChange(order) --判断是否需要显示boss信息 local data = ConfigManager.GetConfigData(ConfigName.MainLevelConfig,FightPointPassManager.curOpenFight) local key = PlayerPrefs.GetInt(PlayerManager.uid.."BattleBossShow"..FightPointPassManager.curOpenFight) - Timer.New(function () - if this.fightType == BATTLE_TYPE.STORY_FIGHT and data.BossPreview and data.BossPreview > 0 and key == 0 then + if this.fightType == BATTLE_TYPE.STORY_FIGHT and data.BossPreview and data.BossPreview > 0 and key == 0 then + + this.EnemyAppear(false)--设置敌人 + Timer.New(function () UIManager.OpenPanel(UIName.BattleBossInfoPanel,function () func() end) - else - func() - end - end,1.5):Start() + end,1.5):Start() + else + this.EnemyAppear(true)--设置敌人 + func() + end + end --刷新敌军站位 @@ -715,6 +720,7 @@ function this.OnUpdate() end end if BattleManager.IsBattlePlaying() and not BattleLogic.IsEnd then + LogGreen("BattleLogic.Update") BattleLogic.Update() -- 再检测一次战斗结束 if BattleLogic.IsEnd then return end