public static void UpdateLabel_UnitAI() { unitAILabel = new string[unitAIDB.unitList.Count + 1]; unitAILabel[0] = "Unassigned"; for (int i = 0; i < unitAIDB.unitList.Count; i++) { string name = unitAIDB.unitList[i].name; if (name == "") { name = "unnamed"; } while (Array.IndexOf(unitAILabel, name) >= 0) { name += "_"; } unitAILabel[i + 1] = name; } TDSEditorWindow.SetUnitAIDB(unitAIDB, unitAIIDList, unitAILabel); TDSEditorInspector.SetUnitAIDB(unitAIDB, unitAIIDList, unitAILabel); dirty = !dirty; }
public static void LoadUnitAI() { unitAIDB = UnitAIDB.LoadDB(); for (int i = 0; i < unitAIDB.unitList.Count; i++) { if (unitAIDB.unitList[i] != null) { //unitAIDB.unitList[i].prefabID=i; unitAIIDList.Add(unitAIDB.unitList[i].prefabID); } else { unitAIDB.unitList.RemoveAt(i); i -= 1; } } UpdateLabel_UnitAI(); TDSEditorWindow.SetUnitAIDB(unitAIDB, unitAIIDList, unitAILabel); TDSEditorInspector.SetUnitAIDB(unitAIDB, unitAIIDList, unitAILabel); }