I try to make a simple game when you have to click all the objects on scene. When you click the object, it become not active. I tried to make a script that checks if all objects are not active, but it don’t work and i don’t have idea why. (Sorry for bad English)
void Update()
{
if (objectsFound == winObjects.Length)
{
Debug.Log("Win");
}
}
private void OnMouseDown()
{
for (int i = 0; i > winObjects.Length; i++)
{
if (winObjects*.active == false)*
{
objectsFound++;
Debug.Log(objectsFound);
}
else
{
objectsFound = 0;
}
}
}
}