-
Notifications
You must be signed in to change notification settings - Fork 0
RequiresMethod
wwwDayDream edited this page May 9, 2024
·
2 revisions
This attribute is used to specify that your plugin requires a specific method to be present (and so we will create it).
Usage: This attribute can be applied multiple times to an assembly.
Parameters:
-
targetType (
Type
): The type to inject the method onto. -
methodName (
string
): The name of the required method. -
returnType (
Type
): The return type of the required method. -
arguments (
params Type[]
): An (optional) number of types representing the arguments of the required method.
Example:
[assembly: RequiresMethod(typeof(Player), "ExampleMethod", typeof(void), new Type[] { typeof(int), typeof(string) })]
Creates
public void ExampleMethod(int pInt, string pString) { }