void SetOne(Transform maxParent, TranInfo tranInfo) { Transform end = maxParent; for (int i = 1; i < tranInfo.indexList.Count; i++) { end = end.GetChild(tranInfo.indexList[i]); } end.gameObject.SetActive(tranInfo.state); }
/// <summary> /// 获取所有激死的物体信息List /// </summary> /// <param name="maxParent"></param> /// <param name="tran"></param> /// <param name="allFaseTranList"></param> /// <returns></returns> List <TranInfo> GetAllFalseTranInfo(Transform maxParent, Transform tran, List <TranInfo> allFaseTranList) { for (int i = 0; i < tran.childCount; i++) { Transform child = tran.GetChild(i); if (child.gameObject.activeSelf == false) { List <int> indexList = GetTranIndexList(maxParent, child, new List <int>()); TranInfo tranInfo = new TranInfo(child, child.gameObject.activeSelf, child.gameObject.name, indexList); allFaseTranList.Add(tranInfo); } GetAllFalseTranInfo(maxParent, child, allFaseTranList); } return(allFaseTranList); }