BITKit/Src/Unity/Scripts/Components/AutoSetLayer.cs

17 lines
369 B
C#
Raw Normal View History

2023-06-05 19:57:17 +08:00
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace BITKit
{
public class AutoSetLayer : MonoBehaviour
{
public int layer;
2024-03-31 23:31:00 +08:00
private void Start()
2023-06-05 19:57:17 +08:00
{
GetComponentsInChildren<Transform>(true).ForEach(x=>
{
x.gameObject.layer=layer;
});
}
}
}