Files
BITKit/Src/Unity/Scripts/Components/AutoSetLayer.cs
2023-09-02 00:51:39 +08:00

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;
});
}
}
}