如何在c#中拦截外部DLL的方法调用?

时间:2018-12-02 06:27:21

标签: c# unity3d hook method-call event-hooking

我正在为Unity游戏解钩创建一个mod。有什么方法可以知道何时调用特定方法,以便我可以在完成时调用我的方法,而不是调用它?例如:

//This is the external method i want to intercept
public void OnPlayerJoin()
{
    Chat.WriteLine(NewPlayer.name + "has joined the game!");
}

//And here is my method that i want to call instead of it in process of interception
public void PlayerJoinHook()
{
    Chat.WriteLine(NewPlayer.name + "has joined the server! Don't forget to read rules!");
}

0 个答案:

没有答案