Esempio n. 1
0
 public static void CopyFromOldDB()
 {
     Init();
     if (instance.copiedFromOldDB)
     {
         return;
     }
     instance.copiedFromOldDB = true;
     instance.unitList        = new List <UnitAI>(UnitAIDB.Load1());
 }
Esempio n. 2
0
        public static List <UnitAI> Load()
        {
            GameObject obj = Resources.Load("DB_TDSTK/DB_UnitAI", typeof(GameObject)) as GameObject;

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

            UnitAIDB instance = obj.GetComponent <UnitAIDB>();
            return(instance.unitList);
        }
Esempio n. 3
0
        public static void LoadUnitAI()
        {
            unitAIDB = UnitAIDB.LoadDB();

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

            UpdateLabel_UnitAI();

            TDSEditorWindow.SetUnitAIDB(unitAIDB, unitAIIDList, unitAILabel);
            TDSEditorInspector.SetUnitAIDB(unitAIDB, unitAIIDList, unitAILabel);
        }
Esempio n. 4
0
 public static void SetUnitAIDB(UnitAIDB db, List <int> IDList, string[] label)
 {
     unitAIDB     = db;
     unitAIIDList = IDList;
     unitAILabel  = label;
 }
Esempio n. 5
0
 public static void SetUnitAIDB(UnitAIDB db, List<int> IDList, string[] label)
 {
     unitAIDB=db;
     unitAIIDList=IDList;
     unitAILabel=label;
 }
Esempio n. 6
0
        public static void LoadUnitAI()
        {
            unitAIDB=UnitAIDB.LoadDB();

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

            UpdateLabel_UnitAI();

            TDSEditorWindow.SetUnitAIDB(unitAIDB, unitAIIDList, unitAILabel);
            TDSEditorInspector.SetUnitAIDB(unitAIDB, unitAIIDList, unitAILabel);
        }