Esempio n. 1
0
        public static void LoadUnit()
        {
            unitDB = UnitDB.LoadDB();

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

            UpdateLabel_Unit();

            TBEditorWindow.SetUnitDB(unitDB, unitIDList, unitLabel);
            TBEditorInspector.SetUnitDB(unitDB, unitIDList, unitLabel);
        }
Esempio n. 2
0
        public static void UpdateLabel_Unit()
        {
            unitLabel    = new string[unitDB.unitList.Count + 1];
            unitLabel[0] = "Unassigned";
            for (int i = 0; i < unitDB.unitList.Count; i++)
            {
                string name = unitDB.unitList[i].unitName;
                if (name == "")
                {
                    name = "unnamed";
                }
                while (Array.IndexOf(unitLabel, name) >= 0)
                {
                    name += "_";
                }
                unitLabel[i + 1] = name;
            }

            TBEditorWindow.SetUnitDB(unitDB, unitIDList, unitLabel);
            TBEditorInspector.SetUnitDB(unitDB, unitIDList, unitLabel);

            dirty = !dirty;
        }