I have 15 game objects that act as text highlights added to a list.
public GameObject[] highlights;
I have a function called Submit() and I want to check to see if any of the game objects in the list are active. If any are active at the time the Submit() function is ran, I want it to set them to inactive.
I have this so far, but I am not sure what to call to set them inactive.
bool allInActive = true;
for (int i = 0; i < highlights.Length; i++)
{
if (highlights[i].activeInHierarchy)
{
allInActive = false;
break;
}
}
if (allInActive)
print (highlights [0]);
break;
When it runs, I can get it to print highlights [0], but when I say highlights.setactive, it doesn’t give me the setactive option.
Probably a simple fix, but I can’t get it.