Example #1
0
    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_Buff[ID] = talentSkill_Buff[i];
        }
        talentSkill_Buff.Remove(Length);
        print("集合长度=" + talentSkill_Buff.Count);
        Length -= 1;
        DataManage.DelTalentSkill_BuffData(ID);
        WindowControl.SetConsole("删除成功");
    }