public static List <Unit> Load() { GameObject obj = Resources.Load("DB_TBTK/UnitDB", typeof(GameObject)) as GameObject; #if UNITY_EDITOR if (obj == null) { obj = CreatePrefab(); } #endif UnitDB instance = obj.GetComponent <UnitDB>(); return(instance.unitList); }
public static void LoadUnit() { unitDB = UnitDB.LoadDB(); for (int i = 0; i < unitDB.unitList.Count; i++) { if (unitDB.unitList[i] != null) { unitIDList.Add(unitDB.unitList[i].prefabID); } else { unitDB.unitList.RemoveAt(i); i -= 1; } } UpdateLabel_Unit(); TBEditorWindow.SetUnitDB(unitDB, unitIDList, unitLabel); TBEditorInspector.SetUnitDB(unitDB, unitIDList, unitLabel); }
public static void SetUnitDB(UnitDB db, List <int> IDList, string[] label) { unitDB = db; unitIDList = IDList; unitLabel = label; }