mirror of
https://github.com/sinai-dev/UnityExplorer.git
synced 2025-06-15 13:57:31 +08:00
Update HookInstance.cs
This commit is contained in:
parent
1e1fb0e27b
commit
fad5fe0620
@ -46,6 +46,19 @@ namespace UnityExplorer.Hooks
|
||||
if (CompileAndGenerateProcessor(PatchSourceCode))
|
||||
Patch();
|
||||
}
|
||||
|
||||
public HookInstance(MethodInfo targetMethod, string code)
|
||||
{
|
||||
this.TargetMethod = targetMethod;
|
||||
this.signature = TargetMethod.FullDescription();
|
||||
|
||||
PatchSourceCode = code;
|
||||
|
||||
if (CompileAndGenerateProcessor(PatchSourceCode))
|
||||
{
|
||||
Patch();
|
||||
}
|
||||
}
|
||||
|
||||
// Evaluator.source_file
|
||||
private static readonly FieldInfo fi_sourceFile = AccessTools.Field(typeof(Evaluator), "source_file");
|
||||
|
Loading…
x
Reference in New Issue
Block a user