-
Notifications
You must be signed in to change notification settings - Fork 9
AddMethodModule
UserR00T edited this page Aug 9, 2021
·
1 revision
This module is used to add a specific method to the target type. By decorating your method with the AddMethodAttribute you will allow UniversalUnityHooks to add your method. Very useful for reflection grabbed methods, like Unity's Enable, Update, and more.
// Source (plugin)
[AddMethodAttribute(typeof(ExampleType))]
public static void Enable(ExampleType exampleType)
{
Debug.Log($"Target type got enabled! {exampleType.name}"); // Console.log for non Unity applications.
}
// Target _after_ injecting (Assembly-CSharp.dll)
public class ExampleType
{
// This method has just been added by UniversalUnityHooks. References and using declarations will be automatically handled.
public void Enable()
{
MyPluginType.Enable(this);
}
}| Name | Description | Default |
|---|---|---|
| Type | ||
| Method | ||
| Flags | ||
| StartCode | ||
| Token | ||
| Direction |