设置layer :不要使用go.layer= intMM;
要使用Nguitool.Setlayer(go,intLayer);
static public void SetLayer (GameObject go, int layer) { go.layer = layer; Transform t = go.transform; for (int i = 0, imax = t.childCount; i < imax; ++i) { Transform child = t.GetChild(i); SetLayer(child.gameObject, layer); } }