private void SetLayer(int layer, bool includeChildren) { Object[] objects = this.GetObjects(includeChildren); Undo.RecordObjects(objects, "Change Layer of " + this.targetTitle); foreach (GameObject obj2 in objects) { obj2.layer = layer; } }