Example #1
0
        void SaveButton()
        {
            GUI.SetNextControlName("SaveButton");
            if (GUILayout.Button("Save"))
            {
                string DATABASE_FILE_NAME   = @"PVQualityDataBase.asset";
                string DATABASE_FOLDER_NAME = @"Database";

                ISQualityDatabase qdb;
                qdb = ISQualityDatabase.GetDatabase <ISQualityDatabase> (DATABASE_FOLDER_NAME, DATABASE_FILE_NAME);

                temparmor.Quality = qdb.Get(temparmor.SelectedQualityID);
                if (_selectedindex == -1)
                {
                    db.Add(temparmor);
                }
                else
                {
                    db.Replace(_selectedindex, temparmor);
                }
                temparmor      = null;
                _selectedindex = -1;
                CreateNewArmor = false;
                show_details   = false;
                GUI.FocusControl("SaveButton");
            }
        }
 void OnEnable()
 {
     //db = ScriptableObject.CreateInstance<ISQualityDatabase> ();
     if (db == null)
     {
         db = ISQualityDatabase.GetDatabase <ISQualityDatabase> (DATABASE_FOLDER_NAME, DATABASE_FILE_NAME);
     }
 }
Example #3
0
        public void LoadQualityDataBase()
        {
            string DATABASE_FILE_NAME   = @"PVQualityDataBase.asset";
            string DATABASE_FOLDER_NAME = @"Database";

            qdb     = ISQualityDatabase.GetDatabase <ISQualityDatabase> (DATABASE_FOLDER_NAME, DATABASE_FILE_NAME);
            options = new string[qdb.Count];
            for (int cnt = 0; cnt < qdb.Count; cnt++)
            {
                options [cnt] = qdb.Get(cnt).Name;
            }
            QDBLoaded = true;
        }