diff --git a/PatchEntryPoint.cs b/PatchEntryPoint.cs index f747828..b5e7a34 100644 --- a/PatchEntryPoint.cs +++ b/PatchEntryPoint.cs @@ -1,12 +1,27 @@ -using System; +using HarmonyLib; +using System; +using UnityEngine.SceneManagement; namespace DiamondTimeViewer { public static class PatchEntryPoint { + private static bool IsPatched; + public static void Start() { - Patcher.OnStartup(); + 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; + } } } } diff --git a/Patcher.cs b/Patcher.cs deleted file mode 100644 index f16255a..0000000 --- a/Patcher.cs +++ /dev/null @@ -1,29 +0,0 @@ -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; - } - } - } -}