public static List <UnitAbility> Load() { GameObject obj = Resources.Load("DB_TBTK/UnitAbilityDB", typeof(GameObject)) as GameObject; #if UNITY_EDITOR if (obj == null) { obj = CreatePrefab(); } #endif UnitAbilityDB instance = obj.GetComponent <UnitAbilityDB>(); return(instance.abilityList); }
public static List <UnitAbility> LoadClone() { GameObject obj = Resources.Load("DB_TBTK/UnitAbilityDB", typeof(GameObject)) as GameObject; #if UNITY_EDITOR if (obj == null) { obj = CreatePrefab(); } #endif UnitAbilityDB instance = obj.GetComponent <UnitAbilityDB>(); List <UnitAbility> list = new List <UnitAbility>(); for (int i = 0; i < instance.abilityList.Count; i++) { list.Add(instance.abilityList[i].Clone()); } return(list); }
public static void LoadUnitAbility() { uAbilityDB = UnitAbilityDB.LoadDB(); for (int i = 0; i < uAbilityDB.abilityList.Count; i++) { if (uAbilityDB.abilityList[i] != null) { uAbilityIDList.Add(uAbilityDB.abilityList[i].prefabID); } else { uAbilityDB.abilityList.RemoveAt(i); i -= 1; } } UpdateLabel_UnitAbility(); TBEditorWindow.SetAbilityDB(uAbilityDB, uAbilityIDList, uAbilityLabel); TBEditorInspector.SetAbilityDB(uAbilityDB, uAbilityIDList, uAbilityLabel); }
public static void SetAbilityDB(UnitAbilityDB db, List <int> IDList, string[] label) { uAbilityDB = db; uAbilityIDList = IDList; uAbilityLabel = label; }
public void Init() { instance = this; unitAbilityDBList = UnitAbilityDB.LoadClone(); }