23 lines
595 B
C#
23 lines
595 B
C#
using Aki.Reflection.Patching;
|
|
using BepInEx;
|
|
using System.Reflection;
|
|
|
|
namespace IcyClawz.MagazineInspector;
|
|
|
|
[BepInPlugin("com.IcyClawz.MagazineInspector", "IcyClawz.MagazineInspector", "1.3.0")]
|
|
public class Plugin : BaseUnityPlugin
|
|
{
|
|
private void Awake() =>
|
|
new MagazinePatch().Enable();
|
|
}
|
|
|
|
internal class MagazinePatch : ModulePatch
|
|
{
|
|
protected override MethodBase GetTargetMethod() =>
|
|
typeof(MagazineClass).GetConstructors()[0];
|
|
|
|
[PatchPostfix]
|
|
private static void PatchPostfix(ref MagazineClass __instance) =>
|
|
__instance.AddAmmoCountAttribute();
|
|
}
|