-
Notifications
You must be signed in to change notification settings - Fork 2
/
Plugin.cs
30 lines (28 loc) · 937 Bytes
/
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
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
using MovementCompany.Component;
using UnityEngine;
namespace MovementCompany
{
[BepInPlugin(MyPluginInfo.PLUGIN_GUID, MyPluginInfo.PLUGIN_NAME, MyPluginInfo.PLUGIN_VERSION)]
public class Plugin : BaseUnityPlugin
{
Harmony _harmony = new Harmony(MyPluginInfo.PLUGIN_GUID);
public static ManualLogSource Log;
private void Awake()
{
Log = Logger;
// Plugin startup logic
Logger.LogInfo($"Plugin {MyPluginInfo.PLUGIN_GUID} is loaded!");
_harmony.PatchAll();
}
public void OnDestroy()
{
GameObject gameObject = new GameObject("MovementAdder");
DontDestroyOnLoad(gameObject);
gameObject.AddComponent<MovementAdder>();
LC_API.ServerAPI.ModdedServer.SetServerModdedOnly();
}
}
}