public static void MyExtraMethod(AttributePatchTest inst, int theArg) { if (theArg >= 20 && theArg < 30) { inst.lastArg = 1000 + theArg; } }
static bool Target_Prefix(AttributePatchTest __instance, int myArg, ref int __result) { if (myArg < 10) { __result = myArg * 100; UnityEngine.Debug.Log($"[{AttributePatchTest.testName}] INFO - Target_Prefix({myArg}) => {__result}"); return(false); } UnityEngine.Debug.Log($"[{AttributePatchTest.testName}] INFO - Target_Prefix({myArg}) ... nop"); return(true); }
static void Target_Postfix(AttributePatchTest __instance, int myArg, ref int __result) { if (myArg >= 10 && myArg < 20) { UnityEngine.Debug.Log($"[{AttributePatchTest.testName}] INFO - Target_Postfix({myArg}) => {__result} -> {myArg * 200}"); __result = myArg * 200; } else { UnityEngine.Debug.Log($"[{AttributePatchTest.testName}] INFO - Target_Postfix({myArg}) ... nop"); } }