在Unity编程时,使用Destroy销毁了物体,但在后面统计的时候还是会统计上
for (int i = 0; i < count; i++) //count = 24
{
//消除重复位置的物体
for (int j = count - 1; j >= 0; j--)
{
if ((point[i] == point[j]) && (i < j))
{
Destroy(GameObject.Find("body" + j));
}
}
}
for (int i = 0; i < count; i++)
{
if (GameObject.Find("body" + i)==true)
{
realCount++;
}
}