using System.Collections; using System.Collections.Generic; using UnityEngine; namespace BITKit { public class AutoSetLayer : MonoBehaviour { public int layer; void Start() { GetComponentsInChildren(true).ForEach(x=> { x.gameObject.layer=layer; }); } } }