Skip to content

RequiresMethod

wwwDayDream edited this page May 9, 2024 · 2 revisions

CessilCellsCeaChells.CeaChore Namespace

RequiresMethodAttribute

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) { }