-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSprinterviewsCore.cs
47 lines (36 loc) · 1.34 KB
/
SprinterviewsCore.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
using System.Reflection;
using BepInEx;
using BepInEx.Logging;
using MonoMod.RuntimeDetour.HookGen;
using Sprinterviews.Patches;
namespace Sprinterviews
{
[ContentWarningPlugin(MyPluginInfo.PLUGIN_GUID, MyPluginInfo.PLUGIN_VERSION, false)]
[BepInPlugin(MyPluginInfo.PLUGIN_GUID, MyPluginInfo.PLUGIN_NAME, MyPluginInfo.PLUGIN_VERSION)]
public class SprinterviewsCore : BaseUnityPlugin
{
public static SprinterviewsCore Instance { get; private set; } = null!;
internal new static ManualLogSource Logger { get; private set; } = null!;
public static Config ConfigFile = new();
private void Awake()
{
Logger = base.Logger;
Instance = this;
HookAll();
Logger.LogInfo($"{MyPluginInfo.PLUGIN_GUID} v{MyPluginInfo.PLUGIN_VERSION} has loaded!");
ConfigFile.LoadFile();
}
internal static void HookAll()
{
Logger.LogDebug("Hooking...");
SprintPatch.Init();
Logger.LogDebug("Finished Hooking!");
}
internal static void UnhookAll()
{
Logger.LogDebug("Unhooking...");
HookEndpointManager.RemoveAllOwnedBy(Assembly.GetExecutingAssembly());
Logger.LogDebug("Finished Unhooking!");
}
}
}