Last active
January 27, 2020 15:47
-
-
Save pardeike/45ad0712720f30627d6f5b4e10f3356f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using HarmonyLib; | |
namespace NoInlining | |
{ | |
public class MainClass | |
{ | |
public static void Main(string[] args) | |
{ | |
var harmony = new Harmony("test"); | |
harmony.PatchAll(); | |
new Test().Method1(); | |
} | |
} | |
[HarmonyPatch(typeof(Test), "Method2")] | |
public static class Patch | |
{ | |
static bool Prefix() | |
{ | |
Console.WriteLine("patch"); | |
return false; | |
} | |
} | |
public class Test | |
{ | |
public void Method1() | |
{ | |
Console.WriteLine("before"); | |
Method2(); | |
Console.WriteLine("after"); | |
} | |
public void Method2() | |
{ | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment