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].ID); } else { perkDB.perkList.RemoveAt(i); i -= 1; } } UpdateLabel_Perk(); TDEditorWindow.SetPerkDB(perkDB, perkIDList, perkLabel); TDEditorInspector.SetPerkDB(perkDB, perkIDList, perkLabel); }
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; } TDEditorWindow.SetPerkDB(perkDB, perkIDList, perkLabel); TDEditorInspector.SetPerkDB(perkDB, perkIDList, perkLabel); dirty = !dirty; }