Как я могу перехватить вызов метода внешней DLL в C #? - PullRequest
0 голосов
/ 02 декабря 2018

Я создаю мод для Unsing-игры.Есть ли способ узнать, когда вызывается конкретный метод, чтобы я мог вызывать мой после его завершения / вместо него?Например:

//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!");
}
...