示例#1
0
        public static void LoadAbility()
        {
            abilityDB = AbilityDB.LoadDB();

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

            UpdateLabel_Ability();

            TDEditorWindow.SetAbilityDB(abilityDB, abilityIDList, abilityLabel);
            TDEditorInspector.SetAbilityDB(abilityDB, abilityIDList, abilityLabel);
        }
示例#2
0
        public static void UpdateLabel_Ability()
        {
            abilityLabel    = new string[abilityDB.abilityList.Count + 1];
            abilityLabel[0] = "Unassigned";
            for (int i = 0; i < abilityDB.abilityList.Count; i++)
            {
                string name = abilityDB.abilityList[i].name;
                if (name == "")
                {
                    name = "unnamed";
                }
                while (Array.IndexOf(abilityLabel, name) >= 0)
                {
                    name += "_";
                }
                abilityLabel[i + 1] = name;
            }

            TDEditorWindow.SetAbilityDB(abilityDB, abilityIDList, abilityLabel);
            TDEditorInspector.SetAbilityDB(abilityDB, abilityIDList, abilityLabel);

            dirty = !dirty;
        }