2
2
using System . Reflection ;
3
3
using Harmony ;
4
4
using OWML . Common ;
5
- using UnityEngine ;
6
5
7
6
namespace OWML . Events
8
7
{
@@ -17,7 +16,7 @@ public HarmonyHelper(IModLogger logger, IModConsole console)
17
16
_console = console ;
18
17
}
19
18
20
- public void AddPrefix < T > ( string methodName , Type patchType , string patchMethodName ) where T : MonoBehaviour
19
+ public void AddPrefix < T > ( string methodName , Type patchType , string patchMethodName )
21
20
{
22
21
var prefix = patchType . GetAnyMethod ( patchMethodName ) ;
23
22
if ( prefix == null )
@@ -29,7 +28,7 @@ public void AddPrefix<T>(string methodName, Type patchType, string patchMethodNa
29
28
Patch < T > ( methodName , prefix , null , null ) ;
30
29
}
31
30
32
- public void AddPostfix < T > ( string methodName , Type patchType , string patchMethodName ) where T : MonoBehaviour
31
+ public void AddPostfix < T > ( string methodName , Type patchType , string patchMethodName )
33
32
{
34
33
var postfix = patchType . GetAnyMethod ( patchMethodName ) ;
35
34
if ( postfix == null )
@@ -41,12 +40,12 @@ public void AddPostfix<T>(string methodName, Type patchType, string patchMethodN
41
40
Patch < T > ( methodName , null , postfix , null ) ;
42
41
}
43
42
44
- public void EmptyMethod < T > ( string methodName ) where T : MonoBehaviour
43
+ public void EmptyMethod < T > ( string methodName )
45
44
{
46
45
Transpile < T > ( methodName , typeof ( Patches ) , nameof ( Patches . EmptyMethod ) ) ;
47
46
}
48
47
49
- public void Transpile < T > ( string methodName , Type patchType , string patchMethodName ) where T : MonoBehaviour
48
+ public void Transpile < T > ( string methodName , Type patchType , string patchMethodName )
50
49
{
51
50
var patchMethod = patchType . GetMethod ( patchMethodName ) ;
52
51
if ( patchMethod == null )
@@ -58,7 +57,7 @@ public void Transpile<T>(string methodName, Type patchType, string patchMethodNa
58
57
Patch < T > ( methodName , null , null , patchMethod ) ;
59
58
}
60
59
61
- public void Patch < T > ( string methodName , MethodInfo prefix , MethodInfo postfix , MethodInfo transpiler ) where T : MonoBehaviour
60
+ public void Patch < T > ( string methodName , MethodInfo prefix , MethodInfo postfix , MethodInfo transpiler )
62
61
{
63
62
var targetType = typeof ( T ) ;
64
63
_logger . Log ( "Trying to patch " + targetType . Name ) ;
0 commit comments