Merge Patcher into PatchEntryPoint
This commit is contained in:
parent
3b204b3a07
commit
0f7b985c5e
2 changed files with 17 additions and 31 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
29
Patcher.cs
29
Patcher.cs
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue