public void Del(int ID) { if (ID == 0) { return; } Destroy(transform.Find("Scroll/Viewport/Content/obj" + ID).gameObject); for (int i = ID + 1; i <= Length; i++) { transform.Find("Scroll/Viewport/Content/obj" + i).GetComponent <CommonAssist>().ID = i - 1; transform.Find("Scroll/Viewport/Content/obj" + i).name = "obj" + (i - 1); talentSkill[ID] = talentSkill[i]; } talentSkill.Remove(Length); print("集合长度=" + talentSkill.Count); Length -= 1; DataManage.DelTalentSkillData(ID); WindowControl.SetConsole("删除成功"); }