Method RequestHook
RequestHook<T>(T, int)
Requests a hook for a native function.
public FunctionHook<T> RequestHook<T>(T handler, int order = 0) where T : Delegate
Parameters
handlerTThe handler to be invoked when this function is called. Once hooked, the original function will not be called, and must be invoked manually via the returned object.
orderintThe execution order for this hook. See the constants in HookOrder.
Returns
- FunctionHook<T>
A wrapper object containing a delegate to the original function. The wrapped object can be disposed to release the hook.
Type Parameters
TThe delegate type that identically matches the native function signature.
RequestHook<T>(void*, int)
Requests a hook for a native function.
public FunctionHook<T> RequestHook<T>(void* handler, int order = 0) where T : Delegate
Parameters
handlervoid*A delegate pointer (delegate*) to be invoked when the original game function is called. Once hooked, the original function will not be called, and must be invoked manually via the returned object.
orderintThe execution order for this hook. See the constants in HookOrder.
Returns
- FunctionHook<T>
A wrapper object containing a delegate to the original function. The wrapped object can be disposed to release the hook.
Type Parameters
TThe delegate type that identically matches the native function signature. Must have the NativeFunctionAttribute applied.