Esempio n. 1
0
        public static void LoadFPSWeapon()
        {
            fpsWeaponDB = FPSWeaponDB.LoadDB();

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

            UpdateLabel_FPSWeapon();

            TDEditorWindow.SetFPSWeaponDB(fpsWeaponDB, fpsWeaponIDList, fpsWeaponLabel);
            TDEditorInspector.SetFPSWeaponDB(fpsWeaponDB, fpsWeaponIDList, fpsWeaponLabel);
        }
Esempio n. 2
0
        public static void UpdateLabel_FPSWeapon()
        {
            fpsWeaponLabel    = new string[fpsWeaponDB.weaponList.Count + 1];
            fpsWeaponLabel[0] = "Unassigned";
            for (int i = 0; i < fpsWeaponDB.weaponList.Count; i++)
            {
                string name = fpsWeaponDB.weaponList[i].name;
                if (name == "")
                {
                    name = "unnamed";
                }
                while (Array.IndexOf(fpsWeaponLabel, name) >= 0)
                {
                    name += "_";
                }
                fpsWeaponLabel[i + 1] = name;
            }

            TDEditorWindow.SetFPSWeaponDB(fpsWeaponDB, fpsWeaponIDList, fpsWeaponLabel);
            TDEditorInspector.SetFPSWeaponDB(fpsWeaponDB, fpsWeaponIDList, fpsWeaponLabel);

            dirty = !dirty;
        }