miuu-diamond-time-viewer/Patcher.cs

29 lines
566 B
C#

using System;
using System.Collections.Generic;
using System.Text;
using HarmonyLib;
using UnityEngine.SceneManagement;
namespace DiamondTimeViewer
{
public static class Patcher
{
private static bool IsPatched;
public static void OnStartup()
{
SceneManager.sceneLoaded += beginPatch;
Config.Init();
}
private static void beginPatch(Scene scene, LoadSceneMode loadSceneMode)
{
if (!IsPatched)
{
new Harmony("com.thearst3rd.diamondviewer").PatchAll();
IsPatched = true;
SceneManager.sceneLoaded -= beginPatch;
}
}
}
}