Hii, i'm trying to execute one function , but not able to complete it successfully, if anybody is there help me .
this is my function code
var clicked : boolean; //Will default to False
function OnMouseDown () {
clicked = true; //Set this one to true
Debug.Log("clicked");
CheckCubes();
}
function CheckCubes() {
var cubes = this.gameObject.FindGameObjectsWithTag("ClickObjects");
for (i=0;i<cubes.length;i++) {
if(clicked) {
cubes*.active=false;*
*}*
*if (!clicked) {*
*break;*
*}*
_if(cubes*.active==false) { // its checking that all cubes are false*_
_*clicked=true;*_
_*}*_
_*if(clicked==true) {*_
_*Application.LoadLevel("level1");*_
_*}*_
_*}*_
_*}*_
_*```*_
_*<p>when i'm try to execute it, </p>*_
_*<ol>*_
_*<li>if i'll click on any cube , it considers that all cubes are clicked, and directly going to next level.*_
_*why is it so?</li>*_
_*</ol>*_