sinmai-mods/LooseDBTables/Process/patch_PowerOnProcess.cs
2024-05-24 21:46:42 +07:00

32 lines
736 B
C#

// ReSharper disable CheckNamespace
// ReSharper disable InconsistentNaming
using System.IO;
using DB;
using MonoMod;
using UnityEngine;
namespace Process;
[method: MonoModIgnore]
public class patch_PowerOnProcess(ProcessDataContainer dataContainer) : PowerOnProcess(dataContainer)
{
private extern void orig_OnStart();
public override void OnStart()
{
var dbPath = Path.Combine(Application.streamingAssetsPath, "DB");
if (Directory.Exists(dbPath))
{
DBLoader.LoadAll(dbPath);
}
else
{
Directory.CreateDirectory(dbPath);
DBLoader.DumpAll(dbPath);
}
orig_OnStart();
}
}