{
EnemyHP Hp;
int i = 0;
public List<GameObject> Enemy = new List<GameObject>();
void Start()
{
Hp = GameObject.FindGameObjectWithTag("Enemy").GetComponent<EnemyHP>();
}
void Update()
{
if (Hp.health <=0 && Enemy[i].activeInHierarchy)
{
Enemy[i].SetActive(false);
}
else if(Hp.health > 0 && Enemy[i].activeInHierarchy == false)
{
Enemy[i].SetActive(true);
}
}
}