Пример #1
0
 /// <summary>
 ///     Saves all the configurations!
 /// </summary>
 private static void SaveConfigurationData()
 {
     // save all configurations
     InternalJEMConfiguration.Save();
     JEMEditorConfiguration.Save();
     JEMAssetsBuilderConfiguration.Save();
 }
Пример #2
0
        private void OnEnable()
        {
            // Load JEM editor resources
            JEMEditorResources.Load();

            // Apply Title
            titleContent = new GUIContent("JEM Configuration", JEMEditorResources.JEMIconTexture);

            // Load all configurations
            InternalJEMConfiguration.Load();
            JEMEditorConfiguration.Load();
            JEMAssetsBuilderConfiguration.Load();
        }
        /// <summary>
        ///     Loads current configuration.
        /// </summary>
        public static JEMEditorConfiguration Load()
        {
            var file = ResolveConfigurationFile();

            if (File.Exists(file))
            {
                Configuration = JsonConvert.DeserializeObject <JEMEditorConfiguration>(File.ReadAllText(file));
                if (Configuration != null)
                {
                    JEMLogger.InternalLog($"JEMEditorConfiguration loaded data from {file}");
                }
                else
                {
                    JEMLogger.InternalLog($"Unable to load JEMEditorConfiguration from file {file}");
                }
                return(Configuration);
            }

            Configuration = new JEMEditorConfiguration();
            Save();
            return(Configuration);
        }