/// <summary> /// Get the MelonInfo of the mod with the provided Assembly /// </summary> /// <param name="modAssembly">Assembly of the mod you want to get MelonInfo for</param> /// <returns></returns> public static MelonInfoAttribute GetModInfo(System.Reflection.Assembly modAssembly) { MelonInfoAttribute callingMod = null; var cust = MelonInfoAttribute.GetCustomAttributes(modAssembly); foreach (var item in cust) { if (item is MelonInfoAttribute) { callingMod = (MelonInfoAttribute)item; } } return(callingMod); }
/// <summary> /// Get the MelonInfo of the mod with the provided Assembly /// </summary> /// <param name="modAssembly">Assembly of the mod you want to get MelonInfo for</param> /// <returns></returns> public static MelonInfoAttribute GetModInfo(System.Reflection.Assembly modAssembly) { MelonInfoAttribute callingMod = null; var cust = MelonInfoAttribute.GetCustomAttributes(modAssembly); var att = modAssembly.GetCustomAttribute <MelonModInfoAttribute>(); Debug.WriteLine(att is null); foreach (var item in cust) { //Debug.WriteLine(item); if (item is MelonInfoAttribute) { callingMod = (MelonInfoAttribute)item; } } return(callingMod); }