public static void LayerCollectiveSetting(Transform trans, Generics.Layers layer) { trans.gameObject.layer = layer.IntLayer(); GameObject[] children = trans.gameObject.GetChildren(includeInactive: true); foreach (GameObject gameObject in children) { gameObject.layer = layer.IntLayer(); } }
public static void LayerCollectiveSetting(Transform trans, Generics.Layers layer) { trans.get_gameObject().set_layer(layer.IntLayer()); GameObject[] children = trans.get_gameObject().GetChildren(true); for (int i = 0; i < children.Length; i++) { GameObject gameObject = children[i]; gameObject.set_layer(layer.IntLayer()); } }