Patch_ClassName_MethodName.cs 858 B

1234567891011121314151617181920212223242526272829
  1. using HarmonyLib;
  2. using GadgetCore.API;
  3. using UnityEngine;
  4. namespace TemplateGadgetMod.Patches // You may create multiple files like this. Use the prefix, the postfix, or both. You can also use a Transpiler if you wish.
  5. {
  6. [HarmonyPatch(typeof(string))]
  7. [HarmonyPatch("MethodName")] // TODO: Correct this information
  8. [HarmonyGadget("TemplateGadgetMod")]
  9. public static class Patch_ClassName_MethodName
  10. {
  11. /*
  12. [HarmonyPrefix]
  13. public static bool Prefix(ClassName __instance)
  14. {
  15. // Add code to run before `MethodName` is called.
  16. return true; // Return false to prevent the vanilla method from running.
  17. }
  18. */
  19. /*
  20. [HarmonyPostfix]
  21. public static void Postfix(ClassName __instance)
  22. {
  23. // Add code to run after `MethodName` is called.
  24. }
  25. */
  26. }
  27. }