Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
        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);
        }
Ejemplo n.º 4
0
 public static void SetAbilityDB(UnitAbilityDB db, List <int> IDList, string[] label)
 {
     uAbilityDB     = db;
     uAbilityIDList = IDList;
     uAbilityLabel  = label;
 }
Ejemplo n.º 5
0
        public void Init()
        {
            instance = this;

            unitAbilityDBList = UnitAbilityDB.LoadClone();
        }