private static void WriteRuntimeConfigFile() { RuntimeAppConfig.Reset(); AppConfig activeConfig = ActiveAppConfig; if (activeConfig == null) { return; } // Collecting all the runtime config values var runtimeConfigValues = new Dictionary <string, string>(); foreach (var settings in GetActiveConfigSettings()) { settings.GetRuntimeConfigSettings(activeConfig, runtimeConfigValues); } // Generating the runtime config object and serializing to json var runtimeConfig = new RuntimeAppConfig(activeConfig.GetGuid(), activeConfig.SafeName, runtimeConfigValues); string configJson = JsonUtility.ToJson(runtimeConfig); // Early out if the file file hasn't chenged if (File.Exists(RuntimeAppConfig.FilePath) && File.ReadAllText(RuntimeAppConfig.FilePath) == configJson) { return; } Directory.CreateDirectory(Path.GetDirectoryName(RuntimeAppConfig.FilePath)); File.WriteAllText(RuntimeAppConfig.FilePath, configJson); AssetDatabase.ImportAsset(RuntimeAppConfig.FilePath); AssetDatabase.Refresh(); }
public static void Reset() { instance = null; }