Skip to content

Commit

Permalink
Fixed replay layout editor config reset on game relaunch
Browse files Browse the repository at this point in the history
  • Loading branch information
NSGolova committed Oct 9, 2024
1 parent c03c584 commit 5c63db1
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Source/1_Config/SerializableSingleton.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ private static void LoadInternal(string path) {
}
private static void SaveInternal(string path, object instance) {
try {
if (!Directory.Exists(ConfigsPath)) {
Directory.CreateDirectory(ConfigsPath);
}
File.WriteAllText(path, JsonConvert.SerializeObject(instance, Formatting.Indented));
} catch (Exception ex) {
Plugin.Log.Error($"Failed to save {typeof(T).Name}! \r\n{ex.Message}");
Expand Down

0 comments on commit 5c63db1

Please sign in to comment.