public static List <FactionAbility> Load()
        {
            GameObject obj = Resources.Load("DB_TBTK/FactionAbilityDB", typeof(GameObject)) as GameObject;

                        #if UNITY_EDITOR
            if (obj == null)
            {
                obj = CreatePrefab();
            }
                        #endif

            FactionAbilityDB instance = obj.GetComponent <FactionAbilityDB>();
            return(instance.abilityList);
        }
        public static List <FactionAbility> LoadClone()
        {
            GameObject obj = Resources.Load("DB_TBTK/FactionAbilityDB", typeof(GameObject)) as GameObject;

                        #if UNITY_EDITOR
            if (obj == null)
            {
                obj = CreatePrefab();
            }
                        #endif

            FactionAbilityDB instance = obj.GetComponent <FactionAbilityDB>();

            List <FactionAbility> list = new List <FactionAbility>();
            for (int i = 0; i < instance.abilityList.Count; i++)
            {
                list.Add(instance.abilityList[i].Clone());
            }

            return(list);
        }
Exemple #3
0
        public static void LoadFactionAbility()
        {
            fAbilityDB = FactionAbilityDB.LoadDB();

            for (int i = 0; i < fAbilityDB.abilityList.Count; i++)
            {
                if (fAbilityDB.abilityList[i] != null)
                {
                    fAbilityIDList.Add(fAbilityDB.abilityList[i].prefabID);
                }
                else
                {
                    fAbilityDB.abilityList.RemoveAt(i);       i -= 1;
                }
            }

            UpdateLabel_FactionAbility();

            TBEditorWindow.SetAbilityDB(fAbilityDB, fAbilityIDList, fAbilityLabel);
            TBEditorInspector.SetAbilityDB(fAbilityDB, fAbilityIDList, fAbilityLabel);
        }
 public static void SetAbilityDB(FactionAbilityDB db, List <int> IDList, string[] label)
 {
     fAbilityDB     = db;
     fAbilityIDList = IDList;
     fAbilityLabel  = label;
 }
        public void Init()
        {
            instance = this;

            facAbilityDBList = FactionAbilityDB.Load();
        }