コード例 #1
0
        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);
        }
コード例 #2
0
        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);
        }
コード例 #3
0
ファイル: _TBEditor.cs プロジェクト: Hengle/TBTKPrototype
        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);
        }
コード例 #4
0
ファイル: I_TBInspector.cs プロジェクト: Hengle/TBTKPrototype
 public static void SetAbilityDB(FactionAbilityDB db, List <int> IDList, string[] label)
 {
     fAbilityDB     = db;
     fAbilityIDList = IDList;
     fAbilityLabel  = label;
 }
コード例 #5
0
        public void Init()
        {
            instance = this;

            facAbilityDBList = FactionAbilityDB.Load();
        }