Problem with checking multiple objects are active.

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

First, add this script to all those “winObjects”:

WinObject.cs

using System.Collections.Generic;
using UnityEngine;

public class WinObject : MonoBehaviour
{
	public static List<WinObject> Instances = new List<WinObject>();
	void OnEnable ()
	{
		Instances.Add( this );
	}
	void OnDisable ()
	{
		Instances.Remove( this );
	}
}

Then, in your main script:

void Update ()
{
	if( WinObject.Instances.Count==0 )
		Debug.Log("Win");
}

It worked! Thank’s you!