-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathPlugin.cs
40 lines (27 loc) · 1.15 KB
/
Plugin.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
using BepInEx;
using HarmonyLib;
using SpinCore.Patches;
namespace SpinCore;
[BepInPlugin(PluginInfo.PLUGIN_GUID, PluginInfo.PLUGIN_NAME, PluginInfo.PLUGIN_VERSION)]
[BepInDependency("com.pink.spinrhythm.moddingutils", "1.0.7")]
internal sealed class Plugin : BaseUnityPlugin
{
private static Plugin instance;
private void Awake() {
if (instance) {
DestroyImmediate(this);
return;
}
instance = this;
// Init logs and patches.
var harmony = new Harmony(PluginInfo.PLUGIN_GUID);
harmony.PatchAll(typeof(MenuPatches));
harmony.PatchAll(typeof(GameStatePatches));
}
#region logging
internal static void LogDebug(string message) => instance.Logger.LogDebug(message);
internal static void LogInfo(string message) => instance.Logger.LogMessage(message);
internal static void LogWarning(string message) => instance.Logger.LogWarning(message);
internal static void LogError(string message) => instance.Logger.LogError(message);
#endregion
}