From 336c1eb71b2f10d7736b6255d8215018e2e47fd5 Mon Sep 17 00:00:00 2001 From: "DESKTOP-DDTRVOR\\asus" <1162187704@qq.com> Date: Mon, 23 Dec 2024 17:17:43 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E7=8E=A9=E5=AE=B6=E7=8A=B6?= =?UTF-8?q?=E6=80=81=E6=9C=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Assets/Script/Battle/BattleManager.cs | 34 +++++++++++++++++-- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/Blacksmith/Assets/Script/Battle/BattleManager.cs b/Blacksmith/Assets/Script/Battle/BattleManager.cs index 2d700535..ea054dea 100644 --- a/Blacksmith/Assets/Script/Battle/BattleManager.cs +++ b/Blacksmith/Assets/Script/Battle/BattleManager.cs @@ -286,6 +286,17 @@ public class BattleManager : MonoBehaviour exp = 0; expLevel = 1; maxExp = JsonTab.Instance.tables.ExpRogue.Get(expLevel).Developexp; + if (playerItems!=null) + { + foreach (var p in playerItems) + { + if (p.player!=null) + { + PrefabPool.ins.RecycleObj(p.player.gameObject); + p.player = null; + } + } + } playerItems = new PlayerRunState[playerParent.Length]; for (int i = 0; i < playerParent.Length; i++) { @@ -301,7 +312,6 @@ public class BattleManager : MonoBehaviour playerItems[idex].equipent = BattleEquipments[idex]; playerItems[idex].RestState(); playerItems[idex].player.SetModel(idex+1); - }); } } @@ -469,6 +479,16 @@ public class BattleManager : MonoBehaviour { if (!player) { + if (playerItems!=null) + { + foreach (var player in playerItems) + { + if (player!=null) + { + player.player.Type = playerAniType.wait; + } + } + } return; } nowTime += Time.deltaTime; @@ -486,9 +506,17 @@ public class BattleManager : MonoBehaviour { foreach (var player in playerItems) { - if (player!=null&& MousterCount>0) + if (player!=null) { - player.RunTimeMove(); + if (MousterCount>0) + { + player.RunTimeMove(); + player.player.Type = playerAniType.play; + } + else + { + player.player.Type = playerAniType.wait; + } } } }