BITKit/Packages/Runtime~/Unity/Scripts/Components/AutoSetLayer.cs

17 lines
361 B
C#

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