This question was
closed Dec 10, 2015 at 07:27 PM by
OkeanTR for the following reason:
The question is answered, right answer was accepted
FindObjectsOfType not find all objects and code not do anything.
Why this code not work ? When i look Inspector it took only Five Objects and that objects not deactive himself. I added my Yoket script to all my objects and activate IEnumerator from another script...
private Yoket[] platformList;
public IEnumerator RestartGameCo()
{
platformList = FindObjectsOfType<Yoket> ();
for(int i = 0; i < platformList.Length; i++)
{
platformList[i].gameObject.SetActive (false);
}
}
Comment
You're not getting any errors? IEnumerator needs a return type, but the function doesn't have any. Does this function even need to be a coroutine? what happens if you use a void function ins$$anonymous$$d?
I try to did your answer and changed couple things. Now work perfect Thanks.