유닛이 죽었을때 시체농락 하는 시스템 제거
This commit is contained in:
parent
152bc5d135
commit
7e5df63807
|
|
@ -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<UnitCtrl>();
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue