sinmai-mods/LooseDBTables/Process/patch_PowerOnProcess.cs

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();
}
}