miuu-diamond-time-viewer/Patcher.cs

30 lines
566 B
C#
Raw Normal View History

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