-
Notifications
You must be signed in to change notification settings - Fork 0
/
Plugin.cs
50 lines (38 loc) · 1.03 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
41
42
43
44
45
46
47
48
49
50
using BepInEx;
using BepInEx.Logging;
using BepInEx.Unity.IL2CPP;
using DiscordRPC;
using HarmonyLib;
using Il2CppInterop.Runtime.Injection;
using Il2CppSystem.Net;
using SODPresence.Behaviours;
using System;
using UnityEngine;
namespace SODPresence;
[BepInPlugin( MyPluginInfo.PLUGIN_GUID, MyPluginInfo.PLUGIN_NAME, MyPluginInfo.PLUGIN_VERSION )]
public class Plugin : BasePlugin
{
public static ManualLogSource Logger;
public static GameObject DiscordManagerObject { get; private set; }
public static DiscordManager DiscordManager { get; private set; }
public override void Load()
{
Logger = Log;
// Plugin startup logic
Log.LogInfo( $"Plugin {MyPluginInfo.PLUGIN_GUID} is loaded!" );
ClassInjector.RegisterTypeInIl2Cpp<DiscordManager>();
#if DEBUG
ClassInjector.RegisterTypeInIl2Cpp<DiscordDebugUI>();
#endif
var harmony = new Harmony( $"{MyPluginInfo.PLUGIN_GUID}" );
harmony.PatchAll();
createDiscordManager();
}
public override bool Unload()
{
return true;
}
private void createDiscordManager()
{
}
}