hi,
I have a script who find all my objects in scene if a tag…
and I have a for to make some condition…
`var comidaVerde : GameObject;
function Awake()
{
comidaVerde = GameObject.FindGameObjectsWithTag(“ComidaVerde”);
}
function Update(){
if(fase1){
if(vida >=4){
Application.LoadLevel (“fase1”);
vida = 1;
}
for(var i = 0; i < comidaVerde.Length; i++){
temComidaVerde = false;
print("entrou");
if ((comidaVerde *!= null) && (!temComidaVerde))*
-
{*
-
temComidaVerde = true;*
-
}*
-
if(!temComidaVerde){*
-
fase2 = true;*
-
Application.LoadLevel ("fase2");*
-
vida = 1;*
-
fase1 = false;*
-
}*
-
}*
}
I want a condition if all objects inside the array are missing , cause i dont want the for continous check if dont have any object in scene to find…
the objects in scene I remove when the character pass through.
thanks