mirror of
https://github.com/BepInEx/BepInEx.git
synced 2026-10-20 01:46:13 +00:00
Revamp AssemblyPatcher and patcher plugins
This commit is contained in:
11 files changed
+660
-313
No files matched your search
@@ -308,6 +308,15 @@ namespace BepInEx
|
||||
public static IEnumerable<T> GetAttributes<T>(object plugin) where T : Attribute =>
|
||||
GetAttributes<T>(plugin.GetType());
|
||||
|
||||
/// <summary>
|
||||
/// Gets the specified attributes of a reflection metadata type, if they exist.
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The attribute type to retrieve.</typeparam>
|
||||
/// <param name="member">The reflection metadata instance.</param>
|
||||
/// <returns>The attributes of the instance, if existing.</returns>
|
||||
public static T[] GetAttributes<T>(MemberInfo member) where T : Attribute =>
|
||||
(T[]) member.GetCustomAttributes(typeof(T), true);
|
||||
|
||||
/// <summary>
|
||||
/// Retrieves the dependencies of the specified plugin type.
|
||||
/// </summary>
|
||||
|
||||
Reference in new issue
Block a user