unity 动态更改GameObject的 layer层级

分类: unity3d |
游戏中,可以这样更改
{
Transform[] transArray = obj.GetComponentsInChildren ();
foreach (Transform trans in
transArray)
{
trans.gameObject.layer = layerValue;
}
}
这里的 layerValue ,
对应 layer列表中的数字
http://s7/mw690/005N7Rnmzy76WHjPYTY36&690动态更改GameObject的 layer层级" TITLE="unity 动态更改GameObject的 layer层级" />