public static void LoadAbility() { abilityDB = AbilityDB.LoadDB(); for (int i = 0; i < abilityDB.abilityList.Count; i++) { if (abilityDB.abilityList[i] != null) { abilityIDList.Add(abilityDB.abilityList[i].ID); } else { abilityDB.abilityList.RemoveAt(i); i -= 1; } } UpdateLabel_Ability(); TDEditorWindow.SetAbilityDB(abilityDB, abilityIDList, abilityLabel); TDEditorInspector.SetAbilityDB(abilityDB, abilityIDList, abilityLabel); }
public static void UpdateLabel_Ability() { abilityLabel = new string[abilityDB.abilityList.Count + 1]; abilityLabel[0] = "Unassigned"; for (int i = 0; i < abilityDB.abilityList.Count; i++) { string name = abilityDB.abilityList[i].name; if (name == "") { name = "unnamed"; } while (Array.IndexOf(abilityLabel, name) >= 0) { name += "_"; } abilityLabel[i + 1] = name; } TDEditorWindow.SetAbilityDB(abilityDB, abilityIDList, abilityLabel); TDEditorInspector.SetAbilityDB(abilityDB, abilityIDList, abilityLabel); dirty = !dirty; }