void LoadDatabase(LSDatabase database)
        {
            _database = database;
            bool isValid = false;

            if (_database != null)
            {
                if (database.GetType() != DatabaseType)
                {
                    //Note: A hacky fix for changing the type of a previously saved database is to turn on Debug mode
                    //and change the script type of the database asset in the inspector. Back it up before attempting!
                }
                DatabaseEditor = new EditorLSDatabase();
                DatabaseEditor.Initialize(this, Database, out isValid);
            }
            if (!isValid)
            {
                Debug.Log("Load unsuccesful");
                this.DatabaseEditor = null;
                this._database      = null;
                IsLoaded            = false;
                return;
            }
            LSFSettingsManager.GetSettings().Database = database;
            LSFSettingsModifier.Save();
            IsLoaded = true;
        }
Example #2
0
 void LoadDatabase(LSDatabase database)
 {
     _database       = database;
     _databaseEditor = (EditorLSDatabase)Activator.CreateInstance(DatabaseEditorType);
     _databaseEditor.Initialize(this, Database);
     LSFSettingsManager.GetSettings().Database = database;
     LSFSettingsModifier.Save();
 }
        public static void Setup()
        {
            //LSFSettingsManagers.GetSettings().Database is the most recent database loaded/created.
            //You can also set this manually by dragging the desired database onto the saved LSFSettings in...
            //'Assets/Resources/LockstepFrameworkSettings'
            LSDatabase database = LSFSettingsManager.GetSettings().Database;

            _currentDatabase = database;
        }
Example #4
0
 internal static void Save()
 {
     if (EditorLSDatabaseWindow.CanSave)
     {
         EditorUtility.SetDirty(LSFSettingsManager.GetSettings());
         EditorApplication.SaveAssets();
         AssetDatabase.Refresh();
     }
 }
Example #5
0
 public static void Initialize()
 {
     if (Loaded == false)
     {
         LSDatabase database = LSFSettingsManager.GetSettings().Database;
         _currentDatabase = database;
         Loaded           = true;
         LockstepManager.Setup();
     }
     Terrain = GameObject.FindObjectOfType <Terrain> ();
 }
Example #6
0
 void OnEnable()
 {
     Window = this;
     this.LoadDatabase(LSFSettingsManager.GetSettings().Database);
     if (this.Database != null)
     {
         _databaseType = LSFSettingsManager.GetSettings().Database.GetType();
         if (_databaseType.Type == null)
         {
             _databaseType = typeof(DefaultLSDatabase);
         }
     }
 }
Example #7
0
        internal static void Save()
        {
            if (EditorLSDatabaseWindow.CanSave)
            {
                EditorUtility.SetDirty(LSFSettingsManager.GetSettings());

                                #if UNITY_5_5_OR_NEWER
                AssetDatabase.SaveAssets();
                                #else
                EditorApplication.SaveAssets();
                                #endif
                AssetDatabase.Refresh();
            }
        }
Example #8
0
        void LoadDatabase(LSDatabase database)
        {
            _database       = database;
            _databaseEditor = (EditorLSDatabase)Activator.CreateInstance(typeof(EditorLSDatabase));
            bool isValid;

            _databaseEditor.Initialize(this, Database, out isValid);
            if (!isValid)
            {
                this._databaseEditor = null;
                this._database       = null;
                IsLoaded             = false;
                return;
            }
            LSFSettingsManager.GetSettings().Database = database;
            LSFSettingsModifier.Save();
            IsLoaded = true;
        }
Example #9
0
        public static void Setup()
        {
            LSDatabase database = LSFSettingsManager.GetSettings().Database;

            _currentDatabase = database;
        }