miuu-diamond-time-viewer/PatchEntryPoint.cs

27 lines
521 B
C#

using HarmonyLib;
using System;
using UnityEngine.SceneManagement;
namespace DiamondTimeViewer
{
public static class PatchEntryPoint
{
private static bool IsPatched;
public static void Start()
{
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;
}
}
}
}