示例#1
0
        public static void LoadPerk()
        {
            perkDB = PerkDB.LoadDB();

            for (int i = 0; i < perkDB.perkList.Count; i++)
            {
                if (perkDB.perkList[i] != null)
                {
                    perkIDList.Add(perkDB.perkList[i].prefabID);
                }
                else
                {
                    perkDB.perkList.RemoveAt(i);      i -= 1;
                }
            }

            UpdateLabel_Perk();

            TBEditorWindow.SetPerkDB(perkDB, perkIDList, perkLabel);
            TBEditorInspector.SetPerkDB(perkDB, perkIDList, perkLabel);
        }
示例#2
0
        public static void UpdateLabel_Perk()
        {
            perkLabel    = new string[perkDB.perkList.Count + 1];
            perkLabel[0] = "Unassigned";
            for (int i = 0; i < perkDB.perkList.Count; i++)
            {
                string name = perkDB.perkList[i].name;
                if (name == "")
                {
                    name = "unnamed";
                }
                while (Array.IndexOf(perkLabel, name) >= 0)
                {
                    name += "_";
                }
                perkLabel[i + 1] = name;
            }

            TBEditorWindow.SetPerkDB(perkDB, perkIDList, perkLabel);
            TBEditorInspector.SetPerkDB(perkDB, perkIDList, perkLabel);

            dirty = !dirty;
        }