-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPlugin.cs
More file actions
42 lines (33 loc) · 1.14 KB
/
Copy pathPlugin.cs
File metadata and controls
42 lines (33 loc) · 1.14 KB
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
using BepInEx;
using BepInEx.Logging;
using BepInEx.Unity.IL2CPP;
using HarmonyLib;
using System.Reflection;
using UnityEngine;
namespace KinThrone;
[BepInPlugin(MyPluginInfo.PLUGIN_GUID, MyPluginInfo.PLUGIN_NAME, MyPluginInfo.PLUGIN_VERSION)]
public class Plugin : BasePlugin
{
private Harmony _harmony;
internal static Plugin Instance { get; set; }
public static Harmony Harmony => Instance._harmony;
public static ManualLogSource LogInstance => Instance.Log;
public static readonly string ConfigPath = Path.Combine(Paths.ConfigPath, MyPluginInfo.PLUGIN_NAME);
public override void Load()
{
Instance = this;
if (Application.productName != "VRisingServer")
{
LogInstance.LogInfo($"{MyPluginInfo.PLUGIN_NAME} is a server mod and won't load on clients!");
return;
}
_harmony = Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly());
Core.Log.LogInfo($"{MyPluginInfo.PLUGIN_NAME}[{MyPluginInfo.PLUGIN_VERSION}] loaded!");
}
public override bool Unload()
{
Config.Clear();
_harmony.UnpatchSelf();
return true;
}
}