miuu-diamond-time-viewer/PatchEntryPoint.cs

27 lines
507 B
C#
Raw Normal View History

2023-08-26 22:16:35 -04:00
using HarmonyLib;
using UnityEngine.SceneManagement;
2023-08-21 19:05:40 -04:00
namespace DiamondTimeViewer
2023-08-21 19:05:40 -04:00
{
public static class PatchEntryPoint
{
2023-08-26 22:16:35 -04:00
private static bool IsPatched;
2023-08-21 19:05:40 -04:00
public static void Start()
{
2023-08-26 22:16:35 -04:00
SceneManager.sceneLoaded += beginPatch;
Config.Init();
}
private static void beginPatch(Scene scene, LoadSceneMode loadSceneMode)
{
if (!IsPatched)
{
new Harmony("com.thearst3rd.diamondtimeviewer").PatchAll();
IsPatched = true;
SceneManager.sceneLoaded -= beginPatch;
}
2023-08-21 19:05:40 -04:00
}
}
}