From 7e5df6380770440e8f9931a9ad888e34357e7f0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=ED=8C=90=EB=8F=8C?= Date: Mon, 4 Dec 2023 21:28:02 +0900 Subject: [PATCH] =?UTF-8?q?=EC=9C=A0=EB=8B=9B=EC=9D=B4=20=EC=A3=BD?= =?UTF-8?q?=EC=97=88=EC=9D=84=EB=95=8C=20=EC=8B=9C=EC=B2=B4=EB=86=8D?= =?UTF-8?q?=EB=9D=BD=20=ED=95=98=EB=8A=94=20=EC=8B=9C=EC=8A=A4=ED=85=9C=20?= =?UTF-8?q?=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Client/Assets/1_Script/Info/UnitCtrl.cs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Client/Assets/1_Script/Info/UnitCtrl.cs b/Client/Assets/1_Script/Info/UnitCtrl.cs index b89988b3..0e1ca78a 100644 --- a/Client/Assets/1_Script/Info/UnitCtrl.cs +++ b/Client/Assets/1_Script/Info/UnitCtrl.cs @@ -18,7 +18,8 @@ public class UnitCtrl : MonoBehaviour float delay; - bool isDie = false; + bool _isDie = false; + public bool isDie { get { return _isDie; } } public void DataSet(long tableIndex) { @@ -40,7 +41,7 @@ public class UnitCtrl : MonoBehaviour enemyUnits = new List(); isHomeAttack = false; delay = 0; - isDie = false; + _isDie = false; } private void Start() { @@ -57,7 +58,7 @@ public class UnitCtrl : MonoBehaviour } private void Update() { - if (PlayCtrl.Instance.isEndGame || isDie) + if (PlayCtrl.Instance.isEndGame || _isDie) return; delay -= Time.deltaTime; if (delay > 0) @@ -90,7 +91,7 @@ public class UnitCtrl : MonoBehaviour } else { - if (enemyUnits[0] != null) + if (enemyUnits[0] != null && !enemyUnits[0].isDie) { anim.SetTrigger("attack"); enemyUnits[0].Attack(unit.attack); @@ -153,7 +154,7 @@ public class UnitCtrl : MonoBehaviour anim.SetBool("isDie", true); components[0].enabled = false; components[1].enabled = false; - isDie = true; + _isDie = true; Destroy(gameObject, 1.0f); } }