docs/api/HarmonyLib.HarmonyPatch.html
Annotation to define your Harmony patch methods
System.Object
System.Attribute
HarmonyPatch
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Delegate, AllowMultiple = true)]
public class HarmonyPatch : HarmonyAttribute, _Attribute
An empty annotation can be used together with TargetMethod(s)
public HarmonyPatch()
An annotation that specifies a method, property or constructor to patch
public HarmonyPatch(MethodType methodType)
| Type | Name | Description |
|---|---|---|
| MethodType | methodType |
The MethodType
|
An annotation that specifies a method, property or constructor to patch
public HarmonyPatch(MethodType methodType, params Type[] argumentTypes)
| Type | Name | Description |
|---|---|---|
| MethodType | methodType |
The MethodType
| | System.Type[] | argumentTypes |
An array of argument types to target overloads
|
An annotation that specifies a method, property or constructor to patch
public HarmonyPatch(MethodType methodType, Type[] argumentTypes, ArgumentType[] argumentVariations)
| Type | Name | Description |
|---|---|---|
| MethodType | methodType |
The MethodType
| | System.Type[] | argumentTypes |
An array of argument types to target overloads
| | ArgumentType[] | argumentVariations |
An array of ArgumentType
|
An annotation that specifies a method, property or constructor to patch
public HarmonyPatch(string methodName)
| Type | Name | Description |
|---|---|---|
| System.String | methodName |
The name of the method, property or constructor to patch
|
An annotation that specifies a method, property or constructor to patch
public HarmonyPatch(string methodName, MethodType methodType)
| Type | Name | Description |
|---|---|---|
| System.String | methodName |
The name of the method, property or constructor to patch
| | MethodType | methodType |
The MethodType
|
An annotation that specifies a method, property or constructor to patch
public HarmonyPatch(string typeName, string methodName, MethodType methodType = MethodType.Normal)
| Type | Name | Description |
|---|---|---|
| System.String | typeName |
The full name of the declaring class/type
| | System.String | methodName |
The name of the method, property or constructor to patch
| | MethodType | methodType |
The MethodType
|
An annotation that specifies a method, property or constructor to patch
public HarmonyPatch(string methodName, params Type[] argumentTypes)
| Type | Name | Description |
|---|---|---|
| System.String | methodName |
The name of the method, property or constructor to patch
| | System.Type[] | argumentTypes |
An array of argument types to target overloads
|
An annotation that specifies a method, property or constructor to patch
public HarmonyPatch(string methodName, Type[] argumentTypes, ArgumentType[] argumentVariations)
| Type | Name | Description |
|---|---|---|
| System.String | methodName |
The name of the method, property or constructor to patch
| | System.Type[] | argumentTypes |
An array of argument types to target overloads
| | ArgumentType[] | argumentVariations |
An array of ArgumentType
|
An annotation that specifies a class to patch
public HarmonyPatch(Type declaringType)
| Type | Name | Description |
|---|---|---|
| System.Type | declaringType |
The declaring class/type
|
An annotation that specifies a method, property or constructor to patch
public HarmonyPatch(Type declaringType, MethodType methodType)
| Type | Name | Description |
|---|---|---|
| System.Type | declaringType |
The declaring class/type
| | MethodType | methodType |
The MethodType
|
An annotation that specifies a method, property or constructor to patch
public HarmonyPatch(Type declaringType, MethodType methodType, params Type[] argumentTypes)
| Type | Name | Description |
|---|---|---|
| System.Type | declaringType |
The declaring class/type
| | MethodType | methodType |
The MethodType
| | System.Type[] | argumentTypes |
An array of argument types to target overloads
|
An annotation that specifies a method, property or constructor to patch
public HarmonyPatch(Type declaringType, MethodType methodType, Type[] argumentTypes, ArgumentType[] argumentVariations)
| Type | Name | Description |
|---|---|---|
| System.Type | declaringType |
The declaring class/type
| | MethodType | methodType |
The MethodType
| | System.Type[] | argumentTypes |
An array of argument types to target overloads
| | ArgumentType[] | argumentVariations |
Array of ArgumentType
|
An annotation that specifies a method, property or constructor to patch
public HarmonyPatch(Type declaringType, string methodName)
| Type | Name | Description |
|---|---|---|
| System.Type | declaringType |
The declaring class/type
| | System.String | methodName |
The name of the method, property or constructor to patch
|
An annotation that specifies a method, property or constructor to patch
public HarmonyPatch(Type declaringType, string methodName, MethodType methodType)
| Type | Name | Description |
|---|---|---|
| System.Type | declaringType |
The declaring class/type
| | System.String | methodName |
The name of the method, property or constructor to patch
| | MethodType | methodType |
The MethodType
|
An annotation that specifies a method, property or constructor to patch
public HarmonyPatch(Type declaringType, string methodName, params Type[] argumentTypes)
| Type | Name | Description |
|---|---|---|
| System.Type | declaringType |
The declaring class/type
| | System.String | methodName |
The name of the method, property or constructor to patch
| | System.Type[] | argumentTypes |
An array of argument types to target overloads
|
An annotation that specifies a method, property or constructor to patch
public HarmonyPatch(Type declaringType, string methodName, Type[] argumentTypes, ArgumentType[] argumentVariations)
| Type | Name | Description |
|---|---|---|
| System.Type | declaringType |
The declaring class/type
| | System.String | methodName |
The name of the method, property or constructor to patch
| | System.Type[] | argumentTypes |
An array of argument types to target overloads
| | ArgumentType[] | argumentVariations |
Array of ArgumentType
|
An annotation that specifies a method, property or constructor to patch
public HarmonyPatch(Type declaringType, Type[] argumentTypes)
| Type | Name | Description |
|---|---|---|
| System.Type | declaringType |
The declaring class/type
| | System.Type[] | argumentTypes |
The argument types of the method or constructor to patch
|
An annotation that specifies a method, property or constructor to patch
public HarmonyPatch(Type[] argumentTypes)
| Type | Name | Description |
|---|---|---|
| System.Type[] | argumentTypes |
An array of argument types to target overloads
|
An annotation that specifies a method, property or constructor to patch
public HarmonyPatch(Type[] argumentTypes, ArgumentType[] argumentVariations)
| Type | Name | Description |
|---|---|---|
| System.Type[] | argumentTypes |
An array of argument types to target overloads
| | ArgumentType[] | argumentVariations |
An array of ArgumentType
|