4
4
using System . Linq ;
5
5
using System . Reflection ;
6
6
using BepInEx ;
7
- using BepInEx . Logging ;
8
7
using HarmonyLib ;
9
8
10
9
namespace Logless
@@ -15,18 +14,10 @@ namespace Logless
15
14
[ BepInPlugin ( PluginInfo . PLUGIN_GUID , PluginInfo . PLUGIN_NAME , PluginInfo . PLUGIN_VERSION ) ]
16
15
public class Plugin : BaseUnityPlugin
17
16
{
18
- // Using GUID for the Harmony instance, so that we can unpatch just this plugin if needed
19
17
private readonly Assembly _assembly = Assembly . GetExecutingAssembly ( ) ;
20
18
private readonly Harmony _harmony = new ( PluginInfo . PLUGIN_GUID ) ;
21
-
22
- internal new static ManualLogSource Logger ;
23
-
24
- // When the plugin is loaded
19
+
25
20
public void Awake ( ) {
26
- // Create masking Logger as internal to use more easily in code
27
- Logger = base . Logger ;
28
-
29
- // Inject custom js and patch c#
30
21
try {
31
22
Patch ( ) ;
32
23
}
@@ -35,12 +26,9 @@ public void Awake() {
35
26
throw ;
36
27
}
37
28
38
- // All done!
39
29
Logger . LogInfo ( $ "Plugin { PluginInfo . PLUGIN_GUID } is loaded!") ;
40
30
}
41
31
42
- // Unpatch if plugin is destroyed to handle in-game plugin reloads
43
- // Remove files we created
44
32
public void OnDestroy ( ) {
45
33
UnPatch ( ) ;
46
34
}
@@ -49,7 +37,6 @@ private void Patch() {
49
37
_harmony . PatchAll ( _assembly ) ;
50
38
}
51
39
52
- // Undoes what Patch() did
53
40
private void UnPatch ( ) {
54
41
_harmony . UnpatchSelf ( ) ;
55
42
}
@@ -76,7 +63,7 @@ private static IEnumerable<MethodBase> TargetMethods()
76
63
}
77
64
78
65
[ HarmonyPrefix ]
79
- private static bool Prefix ( MethodBase __originalMethod ) {
66
+ private static bool Prefix ( ) {
80
67
return false ;
81
68
}
82
69
}
@@ -102,7 +89,7 @@ private static IEnumerable<MethodBase> TargetMethods()
102
89
}
103
90
104
91
[ HarmonyPrefix ]
105
- private static bool Prefix ( MethodBase __originalMethod ) {
92
+ private static bool Prefix ( ) {
106
93
return false ;
107
94
}
108
95
}
0 commit comments