- Home /
Deactivating and Activating a group and all it's children?
Hi Im beginning to work with a set of tools and components that are all game objects and want to be able to easily acticate and de-activate the whole hierachy saving me from banging my head against my desk all day by declaring everything in the hierarchy in order to create an array list. There is simply too much to deal with.
Is there any kind of function in C# that will allow me to deactivate say a group at the top of the hierarchy and in doing so deactivate all it's children aswell.
Im able to just this when unity is not in game mode I just deactivate the parent unity asks do you want to deactivate children aswell I click yes and hey presto so there must be a way to do this with code aswell right?
So far im using something in the way of
void OnGUI ()
{ if(Event.current.type == EventType.keyUp && Event.current.keyCode == KeyCode.Alpha1)
{ conductivity_group.active = false; }
}
The group gets hidden but the children underneath are still visible how do I solve this?
Answer by Meltdown · Feb 15, 2012 at 01:41 PM
Thanks $$anonymous$$eltdown I was just looking into this aswell cheers!