public static void UpdateLabel_Weapon() { weaponLabel = new string[weaponDB.weaponList.Count + 1]; weaponLabel[0] = "Unassigned"; for (int i = 0; i < weaponDB.weaponList.Count; i++) { string name = weaponDB.weaponList[i].weaponName; if (name == "") { name = "unnamed"; } while (Array.IndexOf(weaponLabel, name) >= 0) { name += "_"; } weaponLabel[i + 1] = name; } TDSEditorWindow.SetWeaponDB(weaponDB, weaponIDList, weaponLabel); TDSEditorInspector.SetWeaponDB(weaponDB, weaponIDList, weaponLabel); dirty = !dirty; }
public static void LoadWeapon() { weaponDB = WeaponDB.LoadDB(); for (int i = 0; i < weaponDB.weaponList.Count; i++) { if (weaponDB.weaponList[i] != null) { //weaponDB.weaponList[i].ID=i; weaponIDList.Add(weaponDB.weaponList[i].ID); } else { weaponDB.weaponList.RemoveAt(i); i -= 1; } } UpdateLabel_Weapon(); TDSEditorWindow.SetWeaponDB(weaponDB, weaponIDList, weaponLabel); TDSEditorInspector.SetWeaponDB(weaponDB, weaponIDList, weaponLabel); }