在Unity编程时,使用Destroy销毁了物体,但在后面统计的时候还是会统计上

在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++;
                
            }
            
        }


这里的realcount应该得到8才对,但实际是24,和count的值一致
我的解答思路和尝试过的方法
希望realcount得到8

emm,你在销毁之前debug一下,你可能就没进入销毁逻辑。

img