/// <summary> /// 更新BUFF图标列表 /// </summary> public void UpdateBuffList(Transform head, List <UIHeadBuff> list) { Transform buffItem = head.FindChild("buff"); Transform listParent = buffItem.FindChild("list"); UIItem.ClearList(listParent); int index = 0; for (int i = 0; i < list.Count; i++) { int iconId = list[i].icon; if (iconId == 0) { continue; } Transform icon = UIItem.GetChild(listParent, index.ToString()); icon.gameObject.SetActiveNew(true); UIItem.SetRawImage(icon, iconId, this); index++; } UIItem.SetItemAlign(UIItem.eItemAlignType.Center, listParent); }