miuu-sandbox/PatchEntryPoint.cs

27 lines
483 B
C#
Raw Normal View History

2024-02-01 01:06:57 -05:00
using HarmonyLib;
using System;
using UnityEngine.SceneManagement;
namespace Sandbox
{
public static class PatchEntryPoint
{
private static bool IsPatched;
public static void Start()
{
SceneManager.sceneLoaded += beginPatch;
}
private static void beginPatch(Scene scene, LoadSceneMode loadSceneMode)
{
if (!IsPatched)
{
new Harmony("com.thearst3rd.sandbox").PatchAll();
IsPatched = true;
SceneManager.sceneLoaded -= beginPatch;
}
}
}
}